Change some assertions to debug assertions
These assertions can only trigger because of bugs in the bindings implementation or in the C code and not because of bugs in calling code, so using debug assertions is perfectly fine for them and reduces the number of assertions inlined everywhere in release builds.