If $g_1$ has order $2$, $g_2^2=e$, i.e. $g$ is self-inverse, so $g_1^{-1}=g_1$.
No other elements $g_2,g_3,...,g_n$ are self inverse as $g_1$ is the unique self-inverse element. So in the product $$eg_1g_2\cdots g_n$$
, rearrange $g_2g_3\cdots g_n$ so that each of the $g_2,g_3,...,g_n$ is next to its inverse (we can do this as the group is abelian). $g_1$ is self-inverse so can't be paired off with an element in $g_2, g_3, ...,g_n$. Thus $g_2g_3\cdots g_n=e$, and $eg_1(g_2g_3 \cdots g_n)=eg_1 e= g_1$.
Note that as every element in $S=\{g_2,g_3,...,g_n\}$ can be split into pairs, $|S|$, and so $|G|=|S \cup{e,g_1}|$ is even.