Slow at what and compared to what? If you were being explicit, then you would say run time? Any real world enterprise / business application factors in the system to total cost.
What is the cost comparison when you include in the development time of using compiled languages, developer availability, skill, training etc?
Secondly, doing what? Even your examples at the beginning regarding ML models are wrong. Python is the preferred interface for ML e.g. with PyTorch, the actual ML algorithm is in a compiled language with Python bindings.
Fast API shows similar performance to node based solutions. So comes down to applications and not arbitrary code comparisons.