This whole function can be much shorter if you used the default parameter with a usable value instead of `None` and then checking if it's `None`

Something like:

`os.environ.get(key, self._data.get(key.lower(), default))`