Under pressure, a quasi-two-dimensional electron gas can collapse toward the true two-dimensional (2D) limit. In this limit, the exact exchange-correlation energy per electron has a known finite limit, but general-purpose semilocal approximate density functionals, such as the local density approximation (LDA) and the Perdew-Burke-Ernzerhof generalized gradient approximation (PBE GGA), are known to diverge to minus infinity. Here we consider a model density for a noninteracting electron gas confined to a thickness $L$ by infinite-barrier walls, with a fixed 2D density $1/[\ensuremath{\pi}{({r}_{s}^{\text{2D}})}^{2}]$ and ${r}_{s}^{\text{2D}}=4$ Bohr. We estimate that LDA, PBE, and the strongly constrained and appropriately normed (SCAN) meta-GGA are accurate for the exchange-correlation energy over a wide quasi-2D range, $1.5lL/{r}_{s}^{\text{2D}}l3.85$, but not for smaller $L$. Of these functionals, only SCAN tends to a finite limit when $L$ tends to 0. Since the noninteracting kinetic energy, treated exactly in Kohn-Sham theory, dominates in this limit within a deformable jellium model, all of the general-purpose functionals can estimate the pressure required to achieve any thickness (with SCAN and LDA better than PBE). This pressure vanishes around $L/{r}_{s}^{\text{2D}}=3.85$, where the 3D electron density is roughly that of the valence electrons in metallic potassium, and it reaches about 20 GPa at $L/{r}_{s}^{\text{2D}}=1.5$ and 400 GPa at $L/{r}_{s}^{\text{2D}}=0.6$.