Solution (source code)

= Solution

A weight-zero modular function is invariant under $\Gamma$, so it descends uniquely through the quotient map to a meromorphic function on $\Gamma\backslash\mathfrak h$. Its assumed meromorphic Fourier expansion at every cusp makes the descended function meromorphic in each cusp coordinate. A meromorphic function on a compact Riemann surface is equivalently a holomorphic morphism to the <Riemann sphere>, sending each pole to infinity. Thus there is a morphism
$$
\phi_f:X(\Gamma)\longrightarrow\widehat{\mathbb C}
$$
with $f=\phi_f|_{\Gamma\backslash\mathfrak h}\circ\pi$. The open quotient $\Gamma\backslash\mathfrak h$ is dense in $X(\Gamma)$, so this identity also proves uniqueness.