Merge pull request #4683 from martindurant/docstrings_for_optimize

Do not alter status_codes docstring if it is None