There is a age old solution for managing multiple versions of the same software: gnu stow: https://www.gnu.org/software/stow/
No crazy settings in your profile. Downsides are: You need to have root, you can switch any time but different versions don't work at the same time, and it does not work in windows.