If you have a typed langages like Scala, Kotlin, Java, you can use jextract [1] which is a more high level API. jextract uses clang to parse C headers files and generates a jar file with all the C function seen as Java methods with all the glue generated for you (the downside is i believe that this jar is OS specific).
This API is more for dynamic languages like Clojure, Groovy, JRuby, where you want to do dynamic runtime calls and still get performance (as far as i understand, the JIT generates the adapter code once per call and you can reuse it).
P/Invoke does not parse C headers, but neither does this proposal.
This proposal will pave the way for jextract, though. I would argue this series of JEPs is much closer in spirit to something like Rust's cxx than P/Invoke is.
/** @dll.import("USER32", entrypoint="GetSysColor") */
static native int getSysColor(int nIndex);
versus [DllImport("USER32", EntryPoint = "GetSysColor")]
static extern int GetSysColor(int nIndex);