The GDB executables etc are built for the lower possible denominator, to support the widest range of linux machines. Recently, many Linux distributions have indeed stopped shipping with Python2.7 by default.
I’d suggest to try and sudo apt install python2.7 libpython2.7
. This should not harm the OS – Python3 and Python2 can coexist.
Also see Problem with esp32 debug for Ubuntu. (undefined symbol: _Py_ZeroStruct) - #13 by maxgerhardt.