When I'm that resource constrained, I don't use Python. The changes necessary to make regular Python code performant defeat the goal of making it readable.
There's a reason NumPy's innards aren't Python code.
There's a reason NumPy's innards aren't Python code.