Currently [a set of functions](https://docs.scipy.org/doc/scipy/reference/optimize.html) returns `success=True` or `False`. 

We've discovered this isn't good enough, though, since `False` can convey both "valid result" or "invalid result", and we want behavior to differ in each case. 

[So I think they should be changed](https://github.com/scipy/scipy/pull/7819#issuecomment-331761473) to instead return `{True, False, InvalidResult}`, where `bool(InvalidResult)` is false for backward compatibility, but can be tested for using `if is InvalidResult`.

I'm not sure what the terminology is, but I'm imagining something like the [built-in `NotImplemented`](https://docs.python.org/3/library/constants.html#NotImplemented) that's returned by comparison functions. This is called a "special value" in the docs and is of type `NotImplementedType`.

How to create such an object and what methods/attributes should it have? I should create my own type like `NotImplementedType` also, or is there an existing type that conveys this "flag" concept? It's a similar kind of object to `True`, `False`, `None`, `NotImplemented`, etc.