If anything this is a testament to how slow python can be, and most importantly how easily it pushes you to write miserably unoptimized code.
It could be a bit overkill, but whenever I'm writing code on top of optimizing data structures and memory allocations I always try to minimize the use of if statements to reduce the possibility of branch prediction errors. Seeing woefully unoptimized python code being used in a production environment just breaks my heart.