The gmpy workaroung is not needed anymore because this problem is fixed in smpy with https://github.com/sympy/sympy/pull/13530