It looks like the advertised way to write to the OTP registers is to insert a special statement into the /boot/config.txt file (such as program_usb_boot_mode=1), and then reboot the Pi. Apparently, something during the boot process sees this magic line in config.txt and performs some other magic to actually write to a bit in one of the OTP registers.
Surely there is an easier way to program an OTP register?
Admittedly, you don't want it to be "too easy" to program the OTP registers, because such programming is irreversible. But surely there is an API (perhaps in the bowels of the VC interface?) that would allow me to program an OTP register by writing a C program and executing it? I searched through all the source at https://github.com/raspberrypi/userland but I can't find anything that writes to OTP registers. (Of course reading the OTP registers is easy).
Any advice on how to program an OTP register without resorting to the contortions of modifying config.txt, rebooting, and restoring config.txt?