That's roughly what Pyrex and Cython do: provide a restricted variant of Python (with optional C type declarations!) that is compiled to C for you.