Optimize {$DEFINE x := y} and refactor tmacro.buftext.
First, use static buffer in scanner.dir_define_impl instead of dynamic, as 16 Kb isn’t a lot. Surprisingly, this reduces the running time of all 60 000 dir_define_impls when compiling my application from 72 to 64 ms, which remains true even if using a dynamic buffer that starts small and then grows logarithmically (probably because most of the macros are very short and allocating 16 Kb at once goes the slower way they never reach), but static buffer is also simpler to work with.
Second, outline allocating and freeing the buffer.
Originally I tried to (...fix #40082 (closed), okay) add the quality-of-life possibility to use string literals and one-line comments containing “{” and “}” inside macros, but a closer look makes it clear that this is absolutely impossible.