With the release of CPython 3.14, pdb can attach to a process ID (PID) with:
pdb
python -m pdb -p 1234