Merge pull request #3936 from charris/forward-port-3935

forward-port-3935
BUG: test_fortran_order_buffer fails on big endian architectures.

The numpy unicode string comparison function does not work correctly
for non-native byte orders. That is a problem needing fixing, but
test_fortran_order_buffer is only needed to check that the buffer
works correctly for fortran order buffers, so let the endianess of
test data be the platform default.
Merge pull request #3941 from charris/make-test-endian-independent

BUG: test_fortran_order_buffer fails on big endian architectures.
ENH: Inline check_and_adjust_index

The function takes a considerable amount of time of np.take and
to also fancy indexing. Simple np.takes can speed up by more then
40%, fancy indexes around 10%.
BUG: runtests: make -t option work again
Merge pull request #3947 from seberg/inline-check-index

ENH: Inline check_and_adjust_index
Merge pull request #3948 from pv/runtests-path

BUG: runtests: make -t option work again
MAINT: double underscores in Lapack-lite C module

Strictly speaking, any non-standard name with "__" in it causes
undefined behavior in C. It's also completely unnecessary to use
any in this module.
MAINT: C identifiers causing UB + useless char returns

C identifiers aren't allowed to match "^_[A-Z]". Fixed that in
numpyos.c and removed some more useless underscores.

Changed NumPyOS_ascii_tolower and the code that calls it to handle
ints, not chars. C promotes char to int in so many situations that
char variables are just a pain. (The C standard library uses int
in <ctype.h>, for example.)
MAINT: unused variable, formatting
MAINT: typo
MAINT: fix item_selection.c so it compiles without warnings
Merge pull request #3950 from larsmans/c-fixes

C fixes
ENH: unroll vector minmax loop

Improves speed by 10% on intel cpus.
Simplify code by moving the fenv support check into the dispatcher. fenv works
on all common platforms (including windows), the fallback is not worth it for
the exotic platforms where it might not be available.
ENH: accept callable as message in assert_

Allows deferring evaluation until failure.
Used for blocked minmax test which evaluate array representations for
the error message many thousand times accumulating to a full second
useless runtime.
ENH: High time consumption by PyUFunc_GetPyValues in ufunc_object.c
For every single operation calls, numpy has to extract value of buffersize, errormask
 and name to pack and build error object. These two functions, _extract_pyvals and
PyUFunc_GetPyValues together use >12% of time.
Merge pull request #3945 from juliantaylor/minmax-improve

ENH: unroll vector minmax loop
MAINT: refactor ufunc error object handling

_get_global_ext_obj: retrieves global ufunc object
_get_bufsize_errmask: get only bufsize and errormask from ufunc object
_extract_pyvals: handle NULL extobj

PyUFunc_GetPyValues implemented as _get_global_ext_obj +_extract_pyvals
drop unused first_error variable.

fix errobj memory leak in previous commit.

add some test for the extobj and warning path, the warning tests are
disabled like the raising path as they fail on a bunch of platforms.
Merge pull request #3946 from juliantaylor/pyufunc_refactor

delay error object creation to when errors occur
ENH: Add scalar special cases to Priority getter

Exact Python scalars can never have a priority, but checking
it is expensive. This adds checks for these to the Priority
getter function.