I pretty frequently find myself using tons of magic strings and flip flopping of environment variables in my scripts.
I have implemented something that does this as best as I can here as an example solution. It's essentially a carbon copy of the EnvManager class but with explicitly defined environments so a static type checker can help you make sure you're feeding correct values and parameters to the GPEnvironment object.
This could also be implemented in a .pyi file for EnvManager.py to allow for forwards compatibility with changes to env parameters and type hinting updates could lag behind without causing issues.
![HaydenWelch_0-1721764967861.png HaydenWelch_0-1721764967861.png](https://community.esri.com/t5/image/serverpage/image-id/110420i9D558B95B4E1D8FE/image-dimensions/741x287?v=v2)