Even for NN. I could imagine the same piece of code being fed a network or a sub-part of a network and wanting to use 2nd order derivatives in all cases, for instance in a penalty term, and not wanting to care about the said penalty being zero or not for some of the parameters.