Removal of dead python code
Partial backport of [[https://github.com/bitcoin/bitcoin/pull/14365 | PR14365]]
Commit https://github.com/bitcoin/bitcoin/pull/14365/commits/590a57fdecc2eb2e8208d82e491d09a1986e4f0e
Depends on D7981 (backported out of order)