Provide compile-time flag for avoiding debug overhead

I wanted to build on top of your pull request, so I figured maybe I can make a 2nd order pull request.