After some more googling, I think I found the answer to my own question. The following code works:
(setq auto-mode-alist ())
The list auto-mode-alist seems to be a hash that has file extensions as keys and major modes as values: https://www.emacswiki.org/emacs/AutoModeAlist
Well, just from the brk calls it looks like it allocated about 230 megs, which is on the large side for the clipboard. Maybe whatever was in the clipboard at the time really was that large, or maybe Emacs failed to parse it correctly and ran away for a bit.
If you want to figure out what the problem really is, you either need to find a reliable way to ...
See https://github.com/magit/magit/issues/3458 to learn how to figure out what is wrong.
See https://github.com/magit/magit/issues/3444 to learn why you did not get a more useful error message right away and that we are aware of this and will eventually do something about it.