The Diophantine equation $x^2 + 7y^2 = 2^n$ is "trivial" in the sense that its solutions can be described in a very simple way (see boxed formula near the end for solutions in odd numbers when $n \geq 3$), so I am suspicious that there is anything nontrivial connecting it to the four-square theorem.

Let's take $n \geq 1$. Then $n \geq 2$ since $x^2 + 7y^2 = 2$ has no integral solutions. Reducing both sides of $x^2 + 7y^2 = 2^n$ modulo 2, we get $x + y \equiv 0 \bmod 2$, so a necessary condition on a solution is that $x \equiv y \bmod 2$. That congruence condition is nicely compatible with the fact that the ring of integers of the number field $K := \mathbf Q(\sqrt{-7})$ is
$$
\mathcal O_K := \mathbf Z\left[\frac{1 + \sqrt{-7}}{2}\right] = \left\{\frac{x + y\sqrt{-7}}{2} : x, y \in \mathbf Z, x \equiv y \bmod 2\right\}.
$$
This ring is a UFD since it is a PID: $K$ is an imaginary quadratic field with class number $1$, or you can look at the recent arXiv post by Paul Pollack and Noah Snyder at https://arxiv.org/abs/2010.05033 for a proof that $\mathcal O_K$ is a UFD that doesn't rely on algebraic number theory. A factorization of $2$ into primes in $\mathcal O_K$ is
$$
2 = \frac{1+\sqrt{-7}}{2} \frac{1 - \sqrt{-7}}{2} = \pi\overline{\pi},
$$
where $\pi = (1 + \sqrt{-7})/2$ and $\overline{\pi} = (1 - \sqrt{-7})/2$ are both prime (their norms are both 2).

Since $n \geq 2$, the Diophantine equation $x^2 + 2y^2 = 2^n$ can be rewritten as ${\rm N}((x + y\sqrt{-7})/2) = 2^{n-2}$, where ${\rm N}$ is the norm function on $\mathcal O_K$. A prime element of $\mathcal O_K$ has norm equal to the power of a prime number, so the prime factors of $(x+y\sqrt{-7})/2$ must be prime factors of $2$. The only prime factors of 2 in $\mathcal O_K$ up to sign (the units of $\mathcal O_K$ are $\pm 1$) are $\pi$ and $\overline{\pi}$, so
$$
{\rm N}\left(\frac{x + y\sqrt{-7}}{2}\right) = 2^{n-2} \Longleftrightarrow \frac{x+y\sqrt{-7}}{2} = \pm \pi^k\overline{\pi}^\ell
$$
where $k$ and $\ell$ are nonnegative integers such that $k + \ell = n-2$.

If $k$ and $\ell$ are both positive then $\pi^k\overline{\pi}^\ell$ is divisible in $\mathcal O_K$ by $\pi\overline{\pi} = 2$, which makes $x$ and $y$ both even: $\pi^{k-1}\overline{\pi}^{\ell - 1} = (a + b\sqrt{-7})/2$ for some integers $a$ and $b$, so
$$
\frac{x+y\sqrt{-7}}{2} = \pm 2\frac{a+b\sqrt{-7}}{2} \Longrightarrow x = \pm 2a, y = \pm 2b.
$$
Solutions of $x^2 +7y^2 = 2^n$ with even $x$ and $y$ and $n \geq 2$ can be divided through by $4$ in every term of the equation, so the "interesting" integral solutions of $x^2 + 7y^2 = 2^n$ are the ones where $x$ or $y$ is odd, which means in fact that both $x$ and $y$ are odd, since $x \equiv y \bmod 2$. That forces $k = 0$ or $\ell = 0$:
$$
x^2 + 7y^2 = 2^n \ {\sf with } \ x, y \ {\sf odd} \Longleftrightarrow \frac{x+y\sqrt{-7}}{2} = \pm \pi^{n-2} \ {\sf or } \ \pm \overline{\pi}^{n-2}.
$$
Changing signs on $x$ and $y$ is an easy adjustment, so for $n \geq 2$ the only integral solution of $x^2 + 7y^2 = 2^n$ in odd $x$ and $y$, up to sign, is the coefficients in

$$
\boxed{\frac{x+y\sqrt{-7}}{2} = \pi^{n-2} = \left(\frac{1+\sqrt{-7}}{2}\right)^{n-2}.}
$$

When $n = 2$, $(x + y\sqrt{-7})/2 = \pi^0 = 1$, so $x = 2$ and $y = 0$, which are not odd (this is just saying $x^2 + 7y^2 = 4$ only when $(x,y) = (\pm 2,0)$). For $n \geq 3$, $x$ and $y$ are odd (a proof is below). For example, the only solution of $x^2 + 7y^2 = 2^9$ in odd numbers comes from coefficients of
$$
\frac{x+y\sqrt{-7}}{2} = \pi^7 = \frac{-13 + 7\sqrt{-7}}{2},
$$
so $(x,y) = (13,7)$ up to sign. The unique solution of $x^2 + 7y^2 = 2^n$ in positive odd numbers for $n = 3, 4, 5, 6, 7, 8$ are $(1,1)$, $(3,1)$, $(5,1)$, $(1,3)$, $(11,1)$, and $(9,5)$.

Let's show the coefficients $x$ and $y$ in the boxed formula above are odd when $n \geq 3$: setting $((1+\sqrt{-7})/2)^m = (a_m + b_m\sqrt{-7})/2$, when $m \geq 1$ the integers
$a_m$ and $b_m$ are odd. Since $a_m^2 + 7b_m^2 = 2^{m+2} \equiv 0 \bmod 2$, we have $a_m \equiv b_m \bmod 2$, so it suffices to show $a_m$ is odd. By considering the conjugate formula $((1-\sqrt{-7})/2)^m = (a_m - b_m\sqrt{-7})/2$,
$$
a_m = \left(\frac{1+\sqrt{-7}}{2}\right)^m + \left(\frac{1-\sqrt{-7}}{2}\right)^m.
$$
To check how divisible the integer $a_m$ is by $2$, view the formula for it in the $2$-adic integers, which contains two square roots of $-7$:
$$
1 + 2 + 2^3 + 2^6 + \ldots, \ \ \ 1 + 2^2 + 2^4 + 2^5 \cdots
$$
Embed $\mathbf Q(\sqrt{-7})$ into $\mathbf Q_2$ by letting $\sqrt{-7}$ be the first $2$-adic expansion above. Then the other expansion is $-\sqrt{-7}$, so in $\mathbf Z_2$
$$
\frac{1 + \sqrt{-7}}{2} = 2 + 2^2 + 2^5 + \cdots,
\ \ \
\frac{1 - \sqrt{-7}}{2} = 1 + 2 + 2^3 + 2^4 + \cdots, \ \ \
$$
Thus $(1+\sqrt{-7})/2 \equiv 0 \bmod 2\mathbf Z_2$ and $(1 - \sqrt{-7})/2 \equiv 1 \bmod 2\mathbf Z_2$, so for $m \geq 1$ we have
$((1+\sqrt{-7})/2)^m \equiv 0 \bmod 2\mathbf Z_2$ (not if $m$ is zero!) and $((1 - \sqrt{-7})/2)^m \equiv 1 \bmod 2\mathbf Z_2$. Therefore $a_m \equiv 0 + 1 \equiv 1 \bmod 2\mathbf Z_2$ for $m \geq 1$, so $a_m$ is odd.