I am surprised that containers are not mentioned here. We do similar but use containers instead of env.
Less so for CLI style projects that read and write to the local file system. Yes I know you can bind mount directories but it’s clunky and you also usually have to fight with file permissions issues.