Thank you! I have a pair of these and they recently started beeping occasionally and switching noise canceling mode on their own. I was not looking forward to digging through search results on this.
I've done that too. I ended up just using a local webserver with some Python cgi scripts instead though. I found it more flexible and easier to remember how things worked that way.
I've found it really handy to just have a local Python webserver running on my workstation. Then my bookmarklets can just hit eg http://localhost:8000/cgi-bin/script.py to modify a local file or open up my notes for a certain Jira ticket or whatever else I can think of. There are security considerations with that approach though, since any random site you load can start sending requests to your local webserver.
Last time I compiled standard Lua I think it was only 300-400KB. It has all the cross platform file manipulation capabilities that C does. I was using TCC though, and it does seem to generate small (unoptimized) binaries.