Insanely smart optimizations done. But then you rewrite the whole thing in vanilla Rust without profiling once and it's still 20x faster, and much more readable than the mix of numpy vectorization and C-routines.
It's kind of knowingly entering a sunk-cost fallacy for convenience. Before the cost is even sunk.
Python is often just the wrong choice. And it's not even that much simpler if you ask me.
In a language where you use value-based errors, have powerful sum types and strong typing guarantees, you can often get there faster, too IMO, because you can avoid a lot of mistakes by using the strictness of the compiler in your favor.