On Mon, 2 Jan 2023, 10:22 Corentin Jabot via Lib-Ext, <lib-ext@lists.isocpp.org> wrote:

A further issue is that putenv is non-standard so fixing that in C or C++ will be challenging.
Things I've considered in the past:
  * Doing a copy at launch, but that seems extremely wasteful
  * Standardizing putenv and mandating some kind of thread safety - I wonder how that would go

POSIX says:

FUTURE DIRECTIONS
A future version may add one or more functions to access and modify the environment in a thread-safe manner.

So if there is interest in doing this it should be done in conjunction with WG14 and POSIX.