gh-123011: Fix warn_explicit() with the globals of the __main__ module (GH-155318)