If $N$ is a power of $2$, then $g(x; N) = \sinh x$, which is periodic with period $T = 2\pi i$, so we will ignore this case.
Let $P_N(x) = \sum_{j=0}^{N-1} a_j x^j$ be the unique polynomial of degree at most $N-1$ whose value at every primitive $N^{th}$ root of unity is $1$, and whose value at all other $N^{th}$ roots of unity is $0$ (use Lagrange interpolation, for example). Put $\zeta = \exp(2\pi i/N)$. Then
$$\begin{array}{rcl}
\sum_{j=0}^{N-1} a_j \exp(\zeta^j x) & = & \sum_{j=0}^{N-1} a_j \sum_{k=0}^\infty \frac{\zeta^{jk} x^k}{k!} \\
& = & \sum_{k=0}^\infty \frac{x^k}{k!} \sum_{j=0}^{N-1} a_j \zeta^{jk} \\
& = & g(x; N)
\end{array}$$
since by definition $\sum_{j=0}^{N-1} a_j \zeta^{jk} = 0$ if $k$ is not relatively prime to $N$, and equals $1$ if $k$ is relatively prime to $N$.
For $T$ to be a period, this requires
$$\sum_{j=0}^{N-1} a_j \exp(\zeta^j T) \exp(\zeta^j x) = \sum_{j=0}^{N-1} a_j \exp(\zeta^j x).$$
By linear independence of exponential functions (see e.g. here; the only thing needed is that the $\zeta^j$ are distinct), this forces $a_j \exp(\zeta^j T) = a_j$ for $j = 0, 1, \ldots, N-1$. This forces $\zeta^j T \in 2\pi i \mathbb{Z}$ for all $j$ such that $a_j \neq 0$. Assuming the existence of a period $T \neq 0$, this in turn forces $\zeta^j$ to be a rational multiple of $\zeta^k$ whenever $a_j, a_k$ are nonzero, and the only way that can happen is when $\zeta^j = \pm \zeta^k$.
This puts severe constraints on what $P_N(x)$ can be. For example, $P_N(x)$ can have no more than two monomial terms, and the powers of $x$ in those terms must differ by $N/2$ in view of the $\zeta^j = \pm \zeta^k$ relation. This rules out $N$ being odd, for instance. (To return briefly to the case $N = 2^m$, there one has $P_N(x) = -\frac1{2}(x^{N/2} - 1)$.) So, assuming a period exists, $P_N(x)$ is of type $ax^k + b x^{k + N/2}$. Ultimately, the strain becomes too great for any $N$ but a power of $2$, because for instance it implies
$$a + b(\zeta^j)^{N/2} = 0$$
for each $j$ not relatively prime to $N$, meaning $\zeta^{jN/2} = -a/b$ for all such $j$, which is absurd: it would mean $\zeta^{jN/2} = -1$ for all such $j$. I'll leave it at that.