optimize: restore previous behavior with infinite bounds in SLSQP, document, add tests

Closes #3108.