Ok some more research found this helpful post which shows this is occuring because of X’s autorepeat behaviour. You can disable this by using
os.system('xset r off')
and then reset it using “on” at the end of your script.
The problem is this is global behaviour – not just my script – which isn’t great so I’m hoping someone can come up with a better way.