@EndlessMason Almost every “safe” language has some kind of foreign function interface where guarantees break down. #Java has JNI, Microsoft .NET has P/Invoke, and #Rust just calls theirs #FFI.
Perl’s XS is a glue language mostly made up of #C macros that lets you wire up Perl’s guts to C code. There are also alternatives like #SWIG and FFI::Platypus, the latter of which uses a separate portable library (written in C, natch) that can talk to lots of calling conventions, not just C.