ENH minimize, minimize_scalar: Add support for user-provided methods
Merge pull request #3369 from pasky/minimize-custom

ENH minimize, minimize_scalar: Add support for user-provided methods