Awesome Reviewers

Treat environment-variable driven configuration as untrusted, possibly malformed input, and handle it defensively and consistently.

Example of safer boolean parsing:

def get_debug_flag(default=None):
    val = os.environ.get('FLASK_DEBUG')
    if not val:
        return default
    return val.lower() not in ('0', 'false', 'no')

Applying these practices avoids subtle bugs where configuration behaves differently across casing, platforms, or directory contexts, and keeps environment-driven behavior predictable and well documented.