For a finitely generated module $M$ over a commutative ring $R$, the first definition gives a rank function $r_M: \operatorname{Spec} R \rightarrow \mathbb{N}$, whereas the third definition gives $r_M((0))$.
When $M$ is projective, $r_M$ is locally constant, so when $\operatorname{Spec} R$ is connected -- so when $R$ is a domain -- $r_M$ is constant and may be identified with its value at $(0)$. I think you are asking for reassurance that for finitely generated non-projective modules over a domain, the rank function need not be constant. That's certainly true: take $\mathbb{Z}/p\mathbb{Z}$ over $\mathbb{Z}$ (or even over $\mathbb{Z}_p$): then the rank function is $1$ at $(p)$ and otherwise $0$, so the first definition really is not the same as the third.
Is this a problem? I don't think so. Asking for terminology in mathematics to be globally consistent seems to be asking for too much: even more basic and central terms like "ring" and "manifold" do not have completely consistent definitions across all the mathematical literature: rather, they overlap enough to carry a common idea. That is certainly the case here.
Similarly, asking which of 1) and 3) is "right" doesn't seem so fruitful. It is true that the first definition records more information than the third definition. But it's just terminology, and it is often useful to have a term which records exactly the information in the third definition: e.g. the "rank of an abelian group" is a very standard and useful notion, and usually it means 3). For a finitely generated module over a PID, of course the rank in the sense of 3) is exactly what you need in addition to the torsion subgroup in order to reconstruct the module. In this context the rank function 1) gives some information about the torsion but not complete information -- e.g. $\mathbb{Z}/p\mathbb{Z}$ and $\mathbb{Z}/p^2\mathbb{Z}$ have the same rank function -- so the rank function as in 1) does not seem especially natural or useful. I am (almost) sure there are other contexts where it would be natural and useful to think in terms of the rank function as in 1).