Closes #22136: Fix MSVC compiler warnings introduced by #22085
Issue #22146: Fix typo in __build_class__ error message
Closes #22146: Merge with 3.4