See https://github.com/gmpy2/gmpy2/issues/616#issuecomment-3977893730
See gmpy2/gmpy2#616 (comment)