To test market efficiency, you always need to specify the market's model of price formation
Tests of the efficient markets hypothesis must always include a model of how the market forms prices. One of Fama's big contributions was that you cannot separate these two things in a test. Tests of efficient markets and models of price formations are inherently linked. So, in this case, the assumption of constant real interest rates is merely an assumption of how the market forms prices. Only after assuming this, can we test market efficiency. You might disagree with the model---more sophisticated models will repeat this experiment in that way---but the point is that you have to assume some model for price formation.
Further reading
For more information about this, check out Fama's website. You'll find some links to some books of his. It would be helpful to read at least the first two sections of chapter 5 of his book, "Foundations of Finance."
The argument that he makes in that chapter is approximately the following (borrowing his notation, but changing $\phi$ to $I$).
The point that he makes is that we want to test if the information sets are equal
$I_{t-1}^m = I_{t-1}$, where $I_{t-1}^m$ is the information that the market possesses. But because we can't test this directly, we would like to test
whether the distributions of prices are the same
$$
f_m(p_1,...,p_n \mid I_{t-1}^m) = f(p_1,..., p_n \mid I_{t-1}).
$$
However, this is impossible too. The equality possesses no testable content because we only observe $f(p_1,..., p_n \mid I_{t-1})$ and not $f_m(p_1,...,p_n \mid I_{t-1}^m)$ (see the top of page 137 of the linked chapter). I do not observe the latter because I do not know what $I_{t-1}^m$, except that $I_{t-1}^m \subseteq I_{t-1}$, and I do not know how the market uses this information. For this reason, we specify a model for how the market takes information and turns it into prices. Thus, we specify $f_m$ ourselves (in turn, also specifying what information $I_{t-1}^m$ the market uses). That is, we specify what data the market uses and the way in which it uses that data.
On page 134, Fama says
the statement that prices in an efficient market "fully reflect" available information conveys
the general idea of what is meant by market efficiency, but the statement is too general to be
testable. Since the goal is to test the extent to which the market is efficient, the proposition
must be restated in a testable form. ... this requires a more detailed specification of the process of price formation, one that gives testable content to the term "fully reflect."
Why assume constant rates in the example in Hayashi?
I think it's just an assumption made in that particular example. If you read a little further into the linked chapter, you'll see that Fama discusses 4 different models of market equilibrium. The first two are ridiculous, but he's doing it just to demonstrate the concept. (Part of the reason is that some of the previous ideas about market efficiency had some bizarre consequences, which he demonstrates through those examples.) The point is that any test of market efficiency is always tied to the model that is assumed. If the test fails, you know one of two things: either the market is inefficient or your model of the market is wrong. The unfortunate truth, however, is that you will never know which one it is.