So it's strange, about ten or fifteen minutes after I posted that, the error went away while I was fiddling with something or other. One of those really strange (and terrible) magically disappearing bugs... so the following is no longer urgent, but more for my own edification.
You're right that I never load mediawiki.api. (However, I'm still not loading it and the problem has resolved itself.) But why would I need to load mediawiki.api, and not other mediawiki JS modules? I've been able to use other mw modules in JavaScript without any issues (example: mw.user for getting tokens, or mw.config to get various $wg variables).