It is well known that $\pi(x)$ is the prime counting function , This notation was introduced by number theorist Edmund Landau in 1909 if we define this function as:
$\pi:\mathbb{Z}\to \mathbb{Z} $ then we have the application is $\pi$ which it is identical to the constant $\pi=3.14\dotso$. Why do number theorists define this function using the constant $\pi$? Is there any connection? and how they weren't afraid about confusing between prime counting function and $\pi$ constant?
There was no fear of confusion for the same reason that $i=\sqrt {-1}$ is rarely confused with an index like $$\sum_{i=1}^\infty{x^i}$$ It's because they appear in different contexts. It's not true that $\pi$ never shows up in number theory, but if the constant $\pi$ is intended it would usually not have parentheses after as it would as the prime counting function. If there were potential for confusion, most authors would contort their notation to avoid this.