No magic switch for this... as you have already seen most features are already setup so that if they are not used they don't take up any space
Only way is to rewrite marlin making sure everything is optimised not to use memory where it doesn't have to.
That is a huge amount of work, vs upgrading the controller to one that has a processor that has more memory ($40 ish!)
So basically it unlikely anyone will do this.
But good luck