Taking the variation of the moment of inertia gives
$$
\begin{align}
\delta\int_0^L\left((x-x_0)^2+(y-y_0)^2\right)\,\mathrm{d}s
&=\int_0^L\left(2(x-x_0)\,\delta x+2(y-y_0)\,\delta y\right)\,\mathrm{d}s\\
&=0
\end{align}
$$
Since $\left(\frac{\mathrm{d}x}{\mathrm{d}s}\right)^2+\left(\frac{\mathrm{d}y}{\mathrm{d}s}\right)^2=1$, we can also take the variation of this and integrate by parts to get
$$
\begin{align}
0
&=\delta L\\[9pt]
&=\delta\int_0^L1\,\mathrm{d}s\\
&=\delta\int_0^L\left(\left(\frac{\mathrm{d}x}{\mathrm{d}s}\right)^2+\left(\frac{\mathrm{d}y}{\mathrm{d}s}\right)^2\right)\,\mathrm{d}s\\
&=2\int_0^L\left(\frac{\mathrm{d}x}{\mathrm{d}s}\frac{\mathrm{d}\delta x}{\mathrm{d}s}+\frac{\mathrm{d}y}{\mathrm{d}s}\frac{\mathrm{d}\delta y}{\mathrm{d}s}\right)\,\mathrm{d}s\\
&=-2\int_0^L\left(\frac{\mathrm{d}^2x}{\mathrm{d}s^2}\delta x+\frac{\mathrm{d}^2y}{\mathrm{d}s^2}\delta y\right)\,\mathrm{d}s
\end{align}
$$
So now you have two equations constraining $\delta x$ and $\delta y$:
$$
\begin{align}
0&=\int_0^L\left(\frac{\mathrm{d}^2x}{\mathrm{d}s^2}\delta x+\frac{\mathrm{d}^2y}{\mathrm{d}s^2}\delta y\right)\,\mathrm{d}s\tag{1}\\
0&=\int_0^L\left((x-x_0)\,\delta x+(y-y_0)\,\delta y\right)\,\mathrm{d}s\tag{2}
\end{align}
$$
$(1)$ says that the variation does not change the length of the curve. $(2)$ says the moment of inertia is critical. Therefore, we want any variation that satisfies $(1)$ to satisfy $(2)$. That is, any variation that is orthogonal to $\left(\frac{\mathrm{d}^2x}{\mathrm{d}s^2},\frac{\mathrm{d}^2y}{\mathrm{d}s^2}\right)$ needs to be orthogonal to $(x-x_0,y-y_0)$. Thus, there must be a constant $\lambda$ so that
$$
(x-x_0,y-y_0)=\lambda\left(\frac{\mathrm{d}^2x}{\mathrm{d}s^2},\frac{\mathrm{d}^2y}{\mathrm{d}s^2}\right)\tag{3}
$$
If $\lambda=0$, the curve degenerates to the point $(x_0,y_0)$, so let's assume that $\lambda\ne0$.
Since $\left(\frac{\mathrm{d}x}{\mathrm{d}s}\right)^2+\left(\frac{\mathrm{d}y}{\mathrm{d}s}\right)^2=1$, we have, using $(3)$,
$$
\begin{align}
0&=\lambda\left(\frac{\mathrm{d}x}{\mathrm{d}s}\frac{\mathrm{d}^2x}{\mathrm{d}s^2}+\frac{\mathrm{d}y}{\mathrm{d}s}\frac{\mathrm{d}^2y}{\mathrm{d}s^2}\right)\\
&=(x-x_0)\frac{\mathrm{d}x}{\mathrm{d}s}+(y-y_0)\frac{\mathrm{d}y}{\mathrm{d}s}\\[6pt]
r^2&=(x-x_0)^2+(y-y_0)^2\tag{4}
\end{align}
$$
Thus, assuming the length is constant and the moment of inertia is critical, we get that the curve is an arc of a circle centered at $(x_0,y_0)$.