MAINT: use a mysterious args=(False,) argument instead of using nested function definition
MAINT: add conditional code to support varying versions of scipy fmin optimizers