if the same wrapped function is called more than once. Note that using returning
pointers in directors is still full of traps and not recommended. As such,
warning SWIGWARN_TYPEMAP_DIRECTOROUT_PTR (473) continues to be issued.
The debug Python interpreter failed 3 director testcases which have been
modified in this patch to work around unrecommended director usage
returning from director methods. These are C strings and std::string_view.
A Pyton reference count leak is chosen over undefined behaviour for
returning std::string_view.
Using directorout and string_view is dangerous. Add in warning 473.
For the stable abi < Python 3.10, leak instead of undefined behaviour.
See #2727.
Update warning 473 message text to:
Returning a reference, pointer or pointer wrapper in a director method is not recommended.