There are checks in the compiler for writes and shadowing of ``__debug__``. This can be done earlier, in the symtable, where it is somewhat simpler. <!-- gh-linked-prs --> ### Linked PRs * gh-122246 * gh-122322 <!-- /gh-linked-prs -->