The answer is yes.
Let $\kappa$ be any singular strong limit cardinal of uncountable cofinality, such as the cardinal $\beth_{\omega_1}$ for a specific example, and let $X=\kappa+1$, the ordinals up to and including $\kappa$ itself. Under the order topology, this is a compact Hausdorff space. Note that $|X|=\kappa\neq 2^\alpha$ for any $\alpha$, since $\kappa$ is a strong limit cardinal. But meanwhile, every continuous function $f:X\to\mathbb{R}$ is eventually constant, in order that it is continuous at the final point $\kappa$, because it has uncountable cofinality. So every function in $C(X)$ is determined by a restriction of it $f\upharpoonright\gamma:\gamma\to\mathbb{R}$ for some $\gamma\lt\kappa$. Since $\kappa$ is a strong limit, there are only $\kappa$ many such restricted functions, and so $|C(X)|=\kappa=|X|$, as desired.
Update. If the GCH fails in a convenient way, we can make a much smaller example. Suppose $2^\omega=\omega_1$ and $2^{\omega_1}\gt\omega_2$, and let $X=\omega_2+1$. This is a compact Hausdorff space of size $\omega_2$. Notice that any continuous function $f:X\to\mathbb{R}$ is eventually constant and indeed takes at most countably many distinct values (since otherwise we can find a point $\gamma$ of cofinality $\omega_1$ with $f\upharpoonright\gamma$ not eventually constant, which will violate continuity at $\gamma$.) It follows that $C(X)$ has size $\omega_2^\omega$, which has size $\omega_2$ under our assumptions. So this is a case where $|C(X)|=|X|=\omega_2$, but $\omega_2\neq 2^\alpha$ for any $\alpha$.