Adding inline in Python

This is the same as the inline function in C.
Speed up by expanding shorter functions.
I don’t know if this is necessary,at least this is necessary in one of my projects.

Why is it “necessary” in one of your projects? Explain what your project
does that it needs to inline code?

Can your project really wait until Python 3.11 or maybe 3.12 is
released, in 1-3 years, before using inline code?

Because my project will frequently call some short functions, I think it will be very time-consuming.

You “think” it will be very time consuming, or you have measured it and
the function call overhead is significant?

Here are some quotes from some giants of computer science:

“Premature optimization is the root of all evil in programming.”
C.A.R. Hoare

“More computing sins are committed in the name of efficiency (without
necessarily achieving it) than for any other single reason — including
blind stupidity.” W.A. Wulf

Don’t guess what is making it slow, measure it and find out. Otherwise
you will waste one or two years waiting for Python to add inlining, and
discover that it makes no difference to your code at all.

If your functions are small enough that the function call overhead makes
a difference, chances are they are small enough that you can inline them
yourself.

I’ve rised a similar issue before. Perhaps you’ll learn more from what everyone had to say about it.