Use of App::env() compared to getenv() since Craft 3.4.18
Yes.
It’s not a requirement, but relying on App::env() is the current best practice and we’ve updated the Composer starter project to use it: https://github.com/craftcms/craft/blob/master/config/db.php