Optimize strtr w/ 2nd arg array

Fixes bug #63893: poor efficiency of strtr() using array with keys of
very different length.

The implementation is basically all new, which carries some risk with
it.