Fun fact: you can expose a Go library in the same way using the c-shared build mode.
Also, such interfaces generally require more copying around of structures to match the format the language is expecting. With rust, it can use plain C structs directly without translation.