C does not have weak type safety. Nobody forces you to use void pointers, and glib is just bad in this way by not providing a safe abstraction (and why is it called gpointer?). It is entirely possible to write type safe code in C. It is also possible to write unsafe code, but this is a choice.