Example 1 The range of the function $y=-x^{2}-2 x+3(-5 \leqslant x \leqslant 0)$ is $(\quad)$.
(A) $(-\infty, 4]$
(B) $[3,12]$
(C) $[-12,4]$
(D) $[4,12]$
Solve $y=-(x+1)^{2}+4$, and $-5 \leqslant x \leqslant 0$, so, the range of the function $y=-x^{2}-2 x+3(-5 \leqslant$ $x \leqslant 0)$ is $[-12,4]$, the answer is $\mathrm{C}$.