eval-when-compile は eval-buffer でも eval される.

質問の仕方を変えると, byte compiling 中のみ Non-NIL に
なる変数はどうすれば定義できるか?

(defvar hoge-byte-compiling-p ...)