Here’s how I’ve been clearing all environment vars apart from my “important” ones.
I’ve been using this method for years haha
And since we’re on the subject, here’s the Feature Request I raised in relation to this 2 years ago
This blog post was created off the back of this community tip
Lots of different ways to do the same thing which personally, I kinda like, it then leaves it up to our users to add their own personal stamp on things.