Why Process.fork needs a good alternative in crystal - #14 by ysbaddaden shows a reasonable workaround for executing thread-unsafe code at the start of the process, before the runtime is fully initialized.
Mutating $environ could be implemented in a similar way. But we may need a better hook for that. Currently, even a primitive default execution context is not yet initialized in Crystal.main_user_code, so we cannot use the event loop.