gh-111178: fix UBSan failures in Modules/_tkinter.c
#129795
Merged
8000
Modules/_tkinter.c
#129795