Exercise 2.5 in Otto Forster's Lectures on Riemann Surfaces states
Suppose $p_1,\ldots,p_n$ are points on the compact Riemann surface $X$ and $X':=X\setminus\{p_1,\ldots,p_n\}$. Suppose $$f:X'\to\mathbb{C}$$ is a non-constant holomorphic function. Show that the image of $f$ comes arbitrarily close to every $c\in\mathbb{C}$.
There are two ways in which I was wondering if this exercise can be strengthened. The first is to shrink the domain by replacing $\{p_1,\ldots,p_n\}$ with a closed countable set. That is, if $C$ is any closed countable subset of $X$, $X':=X\setminus C$, and $f:X'\to\mathbb{C}$ is a non-constant holomorphic function, must the image of $f$ still be dense?
Secondly, I was wondering if there is a bound on the number of points missing from the image. Specifically, I want to know if we can show that the image of $f:X\setminus\{p_1,\ldots,p_n\}\to\mathbb{C}$ contains all but finitely many points of $\mathbb{C}$, and if so, I want to know if there is an upper bound on the number of points not in the image in terms of $n$.
For example, when $n=1$, we can show that the image of $f$ contains all but at most one point of $\mathbb{C}$. To see this, suppose $f:X\setminus\{p\}\to\mathbb{C}$ is holomorphic. If $p$ is an essential singularity, then Picard's great theorem implies that the image of $f$ contains all but at most two points of $\mathbb{P}^1_\mathbb{C}$ and thus all but at most one point of $\mathbb{C}$. In the case that $p$ is a pole, $f$ extends to a holomorphic map $X\to\mathbb{P}_\mathbb{C}^1$. But such a map is surjective since $X$ is compact, so $f(X\setminus\{p\})=\mathbb{C}$. Thus, the upper bound when $n=1$ is just $1$.
Edit: The argument I gave for $n=1$ easily generalizes to $n\geq 2$ which somehow didn't occur to me (Thank you AndyPutman for pointing this out). I have added the proof to my answer.