Couldn't you just check for `debug_enabled` early in the function and immediately return `True`?

Or, alternately, if you're really just using it for debugging, it might be better to log warnings when someone get's through using this code path.