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.
Merge pull request #3951 from seberg/scalar-priority

ENH: Add scalar special cases to Priority getter
Merge pull request #3921 from mdickinson/doc-numpy-random-fixes

DOC: Fix misleading description of random_sample in numpy.random docstring.
BUG: core: ensure __r*__ has precedence over __numpy_ufunc__

Add a special case to the implementation of ndarray.__mul__ et al. that
refuses to work on other objects that are not ndarray subclasses and
implement both __numpy_ufunc__ and __r*__.

This way, execution passes first to the custom __r*__ method, which
makes it possible to have e.g. __mul__ and np.multiply do different
things.

Additionally, disable one __array_priority__ special case handling when
also __numpy_ufunc__ is defined.
Merge pull request #3856 from pv/op-before-ufunc

BUG: core: ensure __r*__ has precedence over __numpy_ufunc__
MAINT: io: handle a bad fmt argument in savetxt by raising a ValueError.
BUG: #2052 del scalar subscript causes segfault

Fixes issue #2052, where attempting to delete a scalar field causes a
segfault. Returns ValueError instead, like when attempting to delete an
array element.

Also added a test for this bug.
BUG: wrong boundary check in unrolled memchr
Merge pull request #3953 from WarrenWeckesser/savetxt-bad-fmt-error

MAINT: io: handle a bad fmt argument in savetxt by raising a ValueError.
Merge pull request #3954 from juliantaylor/memchr-bug

BUG: wrong boundary check in unrolled memchr
Merge pull request #3952 from JStech/issue_2052

BUG: #2052 del scalar subscript causes segfault
BUG: fix crash on default errobj

Missing check for optional NULL argument, the case can only happen if
the error mask is 0 (the old default).
closes gh-3962
ENH: merge UFUNC_ERR_DEFAULT2 variable into UFUNC_ERR_DEFAULT

It seems it was added as a precaution to avoid breaking the rather
complicated ufunc code. It effectively disabled the skipping of the
dictionary lookup for the default values for the common case and leading
to hardly tested code in third party libraries like pandas which set the
error state to numpys old default (ignore all).
The skipping improves scalar performance by 2.5-5%.
Merge pull request #3963 from juliantaylor/default-errobj-crash

Default errobj crash
ENH: keep order in np.sort and np.partition copy

avoids unnecessary strided to contig copy for fortran arrays.