I have used a similar design in the past Dan, but found the single switch limiting and the in-line test if debug mode was on wasteful in production code. Sometimes we just want to run the asserts-xx in a small part of the code and not run others.
I still use a global variable as a debug mode switch but it's primarily used to control the (vl-bt) function call in error handlers.
What you see above is not the full testing suite. We try to target specific potential problem areas with a suitable test element.
Please note I'm not suggesting superiority of one system over another ; just indicating what we do.
It's pleasing to me to see that others take testing and error prevention as seriously as we do.
Regards,