AFAIK OpenSCAD does not do any meaningful optimizations that are enabled by having a limited DSL, despite that normally being a good reason to do a DSL. And ironically you often have use a general purpose language (python and C++) to do custom optimizations not possible in the DSL.
OpenSCAD is garbage and I'm not going to defend it. But I would prefer if a new CAD engine didn't regress.