2 examples that come to mind are wuffs and wasm2c. Both produce C code that can be shown to be safe due to the properties of the code generator and its input language.
I am not sure LLM output is amenable to same kind of analysis, but you could conceive of an LLM trained on exclusively safe code.