Let f(z) be a holomorphic function defined on an open neighborhood $R$ of the interval $I=[0,1]\subset \mathbb{R}$. Assume $f$ does not vanish on $I$. Then $g(x) = |f(x)|$ is a real-analytic function on $I$, and thus extends to a holomorphic function $g$ on some neighborhood of $R'\subset R$ of $I$.
Now, $g$ does not necessarily extend to all of $R$. Take, for instance, $f(z) = z + i$, which is of course entire. Then $g(x) = |f(x)| = \sqrt{x^2+1}$ cannot be extended to any domain including $-i$, as then we hit the branch point of the square-root function at $0$.
May we actually construct a region $R'$ where $g$ is guaranteed to be holomorphic, given $R$ and, say, a lower bound on $(\min_{x\in I} |f(x))/(\max_{x\in I} |f(x)|)$? If not, what other conditions could be helpful?
Added remark: what if we have a lower bound on $\frac{\min_{z\in R} |f(z)|}{\max_{z\in R} |f(z)|}$?
Note: the question came out of a conversation with F. Johannson. The added remark is also his.