Instead, I asked my friend Karthikeyan Singaravel, who is a Python core developer, and he recommended using the deadsnakes PPA for Ubuntu to install any version of Python that I chose.
I don’t know who needs to hear this, but deadsnakes is noob bait. It has some utility and convenience for sure, but it’s not portable and will probably hold you back long-term.
Unless you’re running bleeding-edge releases and need managed updates, just pull a tarball from python.org, and follow the README using make altinstall. You can do it; I promise.
If you are in the bleeding-edge camp, conda or uv are more flexible options that fill the same niche and more.