gh-38776: Fix test failures due to global mpmath state
mpmath has a global `mp.pretty` variable that affects how its numbers
are printed. On my machine, it's not reliable. For example:
```
Failed example:
repr(mp.mpc(2,3))
Expected:
'(2.0 + 3.0j)'
Got:
"mpc(real='2.0', imag='3.0')"
```
I've only fixed the tests that are failing for me, since mpmath-1.4 is
on the TODO list. A few different strategies are used:
* `print()` will use the pretty format if all we're doing is displaying
an answer.
* `with workdps` can be used to change the precision only locally.
* In TESTS blocks, the ugly output is acceptable.
* When actually testing `mp.pretty`, we can first clone the `mp` object
with `mp2 = mp.clone()`, and then work on the new one.
URL: https://github.com/sagemath/sage/pull/38776
Reported by: Michael Orlitzky
Reviewer(s): Dima Pasechnik