the user can undefine OPT_LUA and OPT_UBASIC and then scripting in that language becomes unavailable.
Not strictly correct.
The user cannot define those options, only someone compiling their own version can.
That's what I meant. I'm sorry if I confused some readers.
About disabling UBasic, one of the criteria should be the conversion of most of the better scripts. There are some nice scripts for that language, and unless they are converted to Lua, UBasic should be built automatically on the autobuild server. After that I'm pretty sure it can be turned off. Since most users do not use scripting at all, and even less develop scripts, so as long as a script works no one cares what language it has been written in.
Of course there are other ways to squeez out more memory. Exmem or improving the efficiency of other systems are some examples. Loadable modules are a great thing from an architectural point of view, but since it has its own overhead (memory and maybe some trivial runtime linking), the true wins are not clear until fully implemented. Since we only have a couple of 10's of KBs at our hands, this could be a relatively risky undertake.
So currently, in my oppinion, the easiest and most regarding way to save memory is to turn off unneeded features. And CHDK has so many features, that it will have something unneeded for everybody. The only thing to be aware of is to keep the source as clean as possible.
edit: Status update: I have everything working perfectly, the only thing left to do is making badpixel.bin-creation run native without a script. But it's giving me a headache currently. What is the best way to trigger a shoot from C-code and wait for its completion? Or isn't anything like that available?