numbers: speedup gcd
I think there is no reason to use @Memoizer for (almost) internal numbers.gcd .
In my view Memoizer is slow because at least it checks its args.
I propose we use direct approach in performance critical things -- direct cache
without typechecks. We can always wrap such caching with a decorator if we
find a way not to degrade performance.
Timing
------
from sympy.core.numbers import gcd as gcd_
%timeit %timeit %timeit
gcd_(1,1) gcd_(23,17) gcd_(60,3600)
old: 10.7 µs 10.7 µs 10.7 µs
new: 3.07 µs 3.07 µs 3.24 µs