Solution (source code)

= Solution

Set $C=M/R$ and $s=\sqrt{1-2C}$. At the center,
$$
\frac{p_c}{\rho_0}=\frac{1-s}{3s-1}.
$$
The barotropic bound $p_c\leq\omega\rho_0$ implies
$$
1-s\leq\omega(3s-1),
\qquad
s\geq\frac{1+\omega}{1+3\omega}.
$$
Therefore
$$
\boxed{\frac MR\leq
\frac12\left[1-\left(\frac{1+\omega}{1+3\omega}\right)^2\right]
=\frac{2\omega(1+2\omega)}{(1+3\omega)^2}}.
$$
As $\omega\to\infty$, this approaches $4/9$, the limiting value in <Buchdahl's theorem>. Constant-density stars with increasingly large allowed central pressure can therefore approach the Buchdahl bound arbitrarily closely.