I wonder if Iām going to kick a hornetās nest here. But I thought about a way of having parallel code generation possibilities. Meaning that, say a macro is used to read a flag that says: ForbidSecure = True. If true, the macro branches to use a safe routine. if ForbidSecure = False, the macro will take the āefficientā unsafe branch. This aims to remove the branch code from the runtime - the branch instruction does not end up in the binary.
The Medium post says that efficient safe implementation techniques are undocumented. So itās plausible that at first, the Safe code will be slow, but with time, this can be made faster as the optimisation techniques become better standardized (and stable between LLVM editions I hope).
This means the programmer is given a choicebetween safe code and slightly faster code. Right now, the programmer does not have a choice and unsafe if forced upon him or her unceremoniously (so disgraceful
)