If you don't want to pull in musl or a traditional libc, there's a more Wasm-y solution known as the Web Assembly System Interface (WASI) [0] that delegates the libc functionality to the runtime.
A WASI Wasm module can be compiled using clang, as in the article. The only difference is to use the WASI sysroot [1].
> optimization
LTO and -O3 are great! I've also found the Twiggy [2] tool useful for more "manual" optimization.
[0] https://wasi.dev [1] https://github.com/CraneStation/wasi-sdk/releases [2] https://rustwasm.github.io/twiggy/