I've noticed since Craft 3.4.18 there is a
App::env() function from
craft\helpers\App::env(). This was created from the discussion here it seems: https://github.com/craftcms/cms/pull/5893
getenv() can be problematic on multithreaded environments, which is why this change was made.
Should getenv() calls be replaced by
App::env() in PHP code now, if using Craft 3.4.18 or above given the
App::env() function will check
$_ENV first then use
getenv() as a fallback?