Another option might be to prove memory safety for C code. I'm exploring this possibility with https://github.com/jfhg/c2lean by translating C code using Clang to LLVM IR and using LLMs to prove safety or functional properties of the code. For small fragments it's quite nice. I'm not sure how that approach could scale to larger code bases though.