gh-46376: Return existing pointer when possible in ctypes (#107131)

3 files changed