Solved a "null function or function signature mismatch" error (HTML export) and Mac export crash by making a new Godot project and copy/pasting the files into it
Leaving this here in case it helps anyone encountering the same issue!
The issue + unsuccessful attempts to fix it:
My latest game update's HTML export and Mac export no longer worked. Uploading on itch.io resulted in a black screen with "null function or function signature mismatch" error. Mac export crashed upon launch and I couldn't understand anything from the error message.
The game would run fine when I play the project in the Godot editor, but doesn't work well otherwise. For example, I have a script that changes a tilemap's sprite sheet. I use this exact same script in other projects, and in previous versions of this project, and it worked fine. It would work ok when playing the project from the Godot editor but didn't work when I used the "run in local browser" button from the editor, and didn't work in exports either.
Commenting out portions of code and trying to re-export didn't work (tried multiple times, commenting out more and more sections of code each time).
Of course, I also tried restarting both Godot and my computer a couple times.
I'm using Godot 3.5.1 on Mac OS 12.6.
What actually worked:
I created a new Godot project and then copied my game's files into the new project's folder. And then exports just worked fine again! I didn't change any code. When I copied the files over I only copied the scenes, scripts, and assets. Not the ".import" files, not the "project.godot" file (although I did just copy/paste some of its contents into my new "project.godot" file), and not the "export_presets.cfg" file.
My guess is that something messed up the import or export in my project? Probably when I deleted some files in my project folder using my computer's file system, instead of doing it inside the Godot editor. Stupid mistake, I know! I had just accidentally exported my game into my project folder and I thought it would be safe to just delete the HTML export files along with their .import files. I'm not 100% sure if that's what actually caused the issue, but either way I'm just not gonna do that again!