bpo-40807: Show warnings once from codeop._maybe_compile (#20486)

* bpo-40807: Show warnings once from codeop._maybe_compile

* Move catch_warnings

* news

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
3 files changed