Issue #13380: add an internal function for resetting the ctypes caches