I used Bastion before. I'd not be too happy using an interpeted language like Python (that has eval capabilities) for this kind of purpose.
We used it a lot at first, but as our setup got more mature we rarely needed to SSH to our application servers/containers.
In my current project, I did not even setup smth like this.