I was a teaching assistant in a "data structures and algorithms" course where students could choose either Java or Python. Most of the labs were the same except that the treemap lab had to become a hashmap lab for the Python version because it was so excruciatingly slow.
There are reasons other than speed that makes people move away from Python.
Btw, recently CPython has sped up a lot. Between versions 3.9 to 3.12 many programs run about twice as fast. Much of that improvement is thanks to the 'faster-cpython' project (which Microsoft is generously funding).
I contributed about a 1% speedup during that time, too.
Recommend reading this: https://cerfacs.fr/coop/fortran-vs-python