MAINT: const correctness and minor fixes to C code

Fixed some more compiler warnings, many of them related to incorrect handling of `const` with C strings.
`@oneiter@` isn't set until later on.