It's your responsibility to pass the allowed range of value to a function. It a function description tells you to e.g. pass only non-null pointers or only even integers then it's your fault if you don't do it. Inside the function there may me asserts but there is no need to such checks in general.
> There's just sooooo much that you have to get 100% right as a programmer
It's simply the job of the programmer to get it 100% right. No language can do this job for you.