Cornered trying to upgrade Python to avoid 3.8 deprecation

Have you tried this suggestion:

wget "https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz"
tar zxf libffi-3.3.tar.gz
cd libffi-3.3
./configure
sudo make install
sudo ldconfig