You can install previous versions:
yay -S python310 python3.10 --version python3.10 -m venv env
Use virtual environments