Next generation command loop implementation for Python