David C. explained that there is no differences between these three alternatives because of TeX syntax rules (the optional =) or because of the toknizer outputs the same result in case 2 and 3. But you have asked why? The reason is: The optional = is used because this is more understandable by humans. In old days (when TeX was born) each byte was counted. So: the = was not used in the macro bodies because these token strings must be saved into the memory. But this optional = was used outside macro bodies. Today, there is no such memory limitations, the usage of = is recommended.
Your second question: is there any case when = cannot be used. Yes. If the syntax context is not assignment. For example \penalty 10000. The primitive command \penalty is not primitive register, so this is not assignment but this is command to do something in vertical or horizontal list. You cannot use = here.
My last comment: the optional = may have optional space around it (one space left and one right of the =. So, \interlinepenalty= 10000 is also possible. And
\interlinepanalty = 10000
is also possible, because there is no space before = and only one space after the = character because the tokenizer converts this to \interlinepenalty= 10000.
\relaxalso suffices. and is better if a dimension is involved. If a control sequence ("command") follows with no space, TeX will keep on, looking for something that might resolve to a numeric value. – barbara beeton Apr 29 '20 at 17:16\interlinepenaltyis an 〈integer parameter〉). – frougon Apr 29 '20 at 17:18\interlinepenalty: this happens earlier, at the tokenization stage, and is described on p. 46). – frougon Apr 29 '20 at 18:14%is absolutely not a terminator! An%simply says "end this input line right here and (for all practical purposes) attach the start of the next line to what has just been ended. In fact,%is quite dangerous when it immediately follows a numeric value or dimension. A numeric value followed by a space followed by%is okay (the space terminates the numeric value). The situation is more complicated when a line ending with a dimension is terminated by a%, but that's a different question. – barbara beeton Apr 29 '20 at 18:26%is at What is the use of percent signs (%) at the end of lines?.) – barbara beeton Apr 29 '20 at 18:36