I missed this report while researching, so I ended up filing this one: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1058574
It looks like it was an upstream issue where certain code in python.el was brought into emacs 28.2, but didn't make it to 29.