While a defensive approach make sense, your examples are misleading. If a function has parameters, they are not optional unless specified differently.
Checking for nulls not only adds tons of useless code, it also hide problems.
Not hiding problems is another key concept: functions should not worry about every possible input, they should handle every possible meaningful input and fail as soon as possible when the input is not valid. Possibly with a meaningful error description.
Of course some corner cases are meaningful and you can use the Null Object (or special case object) pattern to return a valid object for corner cases.
A very simple example of null object is an empty array. Returning null instead of an empty array from a function is almost always a bad design.
If you start using special case objects instead of spreading if clauses, your code becomes cleaner and defensive. Of course it is not always possible.