\(4x^2+8xy+4y^2+x^2-2x+1+y^2+2y+1=0\)
\(\Leftrightarrow4\left(x+y\right)^2+\left(x-1\right)^2+\left(y+1\right)^2=0\)
\(\Leftrightarrow\left\{{}\begin{matrix}x+y=0\\x-1=0\\y+1=0\end{matrix}\right.\) \(\Rightarrow\left\{{}\begin{matrix}x=1\\y=-1\end{matrix}\right.\)
\(\Rightarrow M=0^{2015}+\left(-1\right)^{2016}+0^{2017}=1\)