There are many real advantages of using compiled code. Python is a very productive language, but it may not fulfil the requirements of a lot of people. Sometimes, we need to interface with code written in a different language. One reason for doing this would be in case we need to access some functionality that is written in a different language that doesn't exist in Python.
As long as the code in question is in a dynamic library that has a C-compatible interface, it's relatively easy to call the code from within Python, using the Foreign Function Interface (FFI) provided by Python's standard ctypes package, which we'll discuss in the next section.
Alternatively, we may need to write some code that runs Close to Metal (CTM), either to maximize the performance of an algorithm that's proven to be a bottleneck...