Let $\gamma \subset \mathbb{C}$ be a simple closed curve, let $z$ be a point inside $\gamma$ and let $f$ be an analytic function defined on the interior of $\gamma$, extending continuously to $\gamma$. Let $M$ be the maximum value of $f$ on $\gamma$. I claim that $|f(z)| \leq M$.
Proof: Let $L$ be the length of the curve $\gamma$, and let $r$ be the distance from $z$ to the closest point of $\gamma$. Then Cauchy's theorem gives $f(z) = (2 \pi i )^{-1} \int_{\zeta \in \gamma} f(\zeta)/(\zeta-z)$ so $|f(z)| \leq LM/(2 \pi r)$. This is similar to the desired bound but, unless $\gamma$ is a circle an $z$ its center, $L$ will be bigger than $2 \pi r$.
To fix the problem, consider the family of functions $f(z)^n$, as $n$ ranges through the positive integers. Then the same proof shows $|f(z)|^n \leq L M^n/(2 \pi r)$. Taking $n$-th roots and sending $n$ to $\infty$, we conclude that $|f(z)| \leq M$.