Code with the necessary level of defense isn't defensive code, it's just code. It becomes defensive when you add too much defense. Like C programmers writing if(!ptr) return -EBADPTR; at the start of every function instead of just letting it crash.
(Yes it's technically undefined behaviour and not guaranteed to crash. In practice, an errant null does crash, producing a much more debuggable symptom than an ignored error code, and we are writing code for real compilers that actually exist.)
Depends on what it's code for. For aircraft software, "just letting it crash" can be unpleasantly literal.