python_header: try to write MatrixExpr as Matrix on return

This should allow "subs" to work with "A^n".