Description
@mtsokol removed set_string_function
from the public API in #24376, but the code and underlying C implementation are still in the codebase. The python version is marked as deprecated but the equivalent C API isn't.
We should replace the usages in docstrings with printoptions
and remove it from the codebase. This also includes the public C API function PyArray_SetStringFunction
which we may need to just stub out but leave behind for API stability, unfortunately this was missed for 2.0. A github search finds no usages outside of numpy itself or re-exports of the numpy C API.
The main reason I'd like to do this is this API is implemented using global variables and is not thread-safe. There's no reason to update code to be thread safe if it's private and only needed for a deprecated function that is no longer public.