Cython has long been an interesting alternative here - a gradually typed amalgam of Python & C that lets you write/compile Python extension modules without needing to learn much of the CPython API. You can even use --embed to compile your whole script file and -X infer_types.verbose=True to let you know where types are dynamic/implicit rather than declared. Several big core packages like scipy use Cython. Few seem to mention it as a wholesale replacement for CPython which it absolutely can be.
Personally, I prefer Nim [2] which has more compile-time meta-programming support, is strongly typed from the outset, and has a lot of syntactic flexibility like UFCS, a "command call syntax" and many other goodies.
Comments
Cython has long been an interesting alternative here - a gradually typed amalgam of Python & C that lets you write/compile Python extension modules without needing to learn much of the CPython API. You can even use --embed to compile your whole script file and -X infer_types.verbose=True to let you know where types are dynamic/implicit rather than declared. Several big core packages like scipy use Cython. Few seem to mention it as a wholesale replacement for CPython which it absolutely can be.
Personally, I prefer Nim [2] which has more compile-time meta-programming support, is strongly typed from the outset, and has a lot of syntactic flexibility like UFCS, a "command call syntax" and many other goodies.
[1] https://cython.org/
[2] https://nim-lang.org/