People should keep in perspective that Python 2.7 was “sun-setted” by Python Foundation to be effective 1 Jan 2020 (more than 2 years ago). See Sunsetting Python 2 | Python.org where they explain it. The intention of this deprecation was announced many years before, and officially the date for “last version” set in 2019. As they say, time for Python people to move on.
The above is a great explanation of how to reinstall Python 2.x in an outstanding virtual environment, Anaconda, which becomes independent of the macOS operating system offering of Python 3.x. If you must keep using Python 2.x, this a good way to do it. I understand how avoiding change is preferred sometimes. There are other virtual environment applications out there for you to discover.
It’s also a good (and highly recommended) that you install and move to your own Python 3.x environment on your Mac. Using Anaconda for this by setting up another virtual environment to do so is a good idea. You have, thus, both Python 2.x an 3.x available to you without interfering with the version Apple provides.
In my view, and the view of many others, that you should keep you Python environments seperate from the Apple version so that as you add libraries to Python (truly there are so many valuable and useful ones) you add them to your version in the virtual environment (Anaconda or other). Apple provides Python for their own uses in macOS as a number of their services depends on it. It is risky to mess with the system-provided Python.
Meantime, best to migrate your stuff off Python 2.x to 3.x and beyond. Python provides some good tools to make that simple if your systems are complex.
I’ve used Anaconda for many years, and Python for many years before that for small/simple and big/complex solutions. Highly recommended.
Python 3 isn’t actually installed by default on a fresh installation of Monterey. Trying to run Python for the first time actually runs a script to install Python 3.