[3.11] gh-94808: Cover `PyFunction_GetCode`, `PyFunction_GetGlobals`,… (#98317)

[3.11] gh-94808: Cover `PyFunction_GetCode`, `PyFunction_GetGlobals`, `PyFunction_GetModule` (GH-98158).
(cherry picked from commit 7b48d02933639c91ebd957b2326d8c352d8eddec)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 files changed