EDIT/NOTE: Please see the comment below from @oferchen, this is supported properly in the build system now
Get the patch file (python3-static-link-openssl.patch
) and put it in your working directory
$ wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tar.xz
$ tar -xvf Python-3.8.12.tar.xz && cd Python-3.8.12
$ patch -p1 < ../python3-static-link-openssl.patch