Suppose one has function $f(z)$ analytic in the unit disk. Suppose closed loop $L$ lies in the disk except for one point $P$ on the boundary. Then the Cauchy integral theorem generally does not apply and one can't always conclude that $\int_L f(z)dz=0$.

Do there exist theorems which do recover the conclusion subject to suitable restrictions on the boundary behavior of $L$ and $f$? How about, for example, for modular forms $f$ and loops $L$ with $P$ sitting on a sufficiently sharp cusp (sharp enough, say so that the two branches of $L$ extending from $P$ lie close together in the Poincare metric)?

Perhaps the right statement might not apply to all $L$, but, say, only to almost all $L$ equivalent up to rotation (again with $P$ on a sufficiently sharp cusp or whatever)?

Please don't hesitate to answer because I haven't get the question exactly right.