maxiter will always be `not None` because it is set to `maxiter=100` in the function signature.