I don't think that's necessarily true, using constexpr facilities you could make a function do nothing according to a compile-time variable value
Something like:
void MyDebugLog(text) {
if (<constepxr check if logging enabled>) {
// actually log...
}
}