For addPath, it's values are always prepended to the "current" PATH, c.f. actions/toolkit#655
Hi @mayeut, I have some concerns about this feature. In order to use python that is installed by action without $PATH updating you should use exact paths to the installed python in a composite action. If there are any other tools in composite action which use python implicitly, then these tools will not use the version you expect. This can lead to confusion about which python version is used in some command or tool.
From my point of view an installation of python without adding to PATH may create more complications than solve problems.
This is an opt-in feature. It won't change a thing for existing users. If they choose to opt-in, they shall know the implications.
As said in an earlier comment, it's just impossible to restore the environment as it was before running