Refactor Arb `visit` functions

Refactor some of the `visit` functions according to comments from Fredrik Johansson, author of Arb.

* Minimize usage of temporary variables
* Clear temporary variables after they have been used.
I'll fix this in a separate PR.