ENH: replace Py_BuildValue with faster PyTuple_Pack
ENH: replace PyUFunc_GetPyValues with faster _get_bufsize_errmask

avoids unnecessary creation of unused error objects.
MAINT: remove unused variable
ENH: early return from PyArray_EquivTypenums if the numbers are equal
Merge pull request #4010 from juliantaylor/reduce-opt

reduction micro optimizations