gh-111178: fix UBSan failures in Modules/_functoolsmodule.c
#129778
+46
−29
Merged