This is not a complete answer, but does offer you some ideas.
If f is of bounded variation on the interval of periodicity you can use the Fourier series for f and it will converge pointwise to f. I haven't constructed a proof, but I think the bounded variation will force f'' to be bounded. Functions which are not of bounded variation on a closed interval either would lead to a discontinuous f or are pretty unpleasant. It is possible that this condition will be acceptable to you.
If f is not of bounded variation it may be that there is no solution. However you might try a sequence of splines. The way to do that is:
Let us presume the interval of periodicity is 1. If f' exists at 0 and 1 then let $g_1$ be a polynomial of 3rd degree such that $g_1$(0) = f(0), $g_1$'(0) = f'(0), $g_1$(1) = f(1), $g_1$'(1) = f'(1). You can do this because the 3rd degree polynomial has 4 coefficients. If f'(0) does not exist, you can use the slope of the secant line from 0 to $\epsilon_n$ where $\epsilon_n$ is a small number that decreases with n.
$g_1$ is certainly twice differentiable. Its second derivative is continuous on [0,1] so is bounded there (which doesn't get you uniform boundedness, but it's a start).
To construct $g_2$ do the same process on the intervals [0,1/2] and (1/2,1]. However, for the piece from 1/2 to 1 you match the derivative at 1/2 to the $g_2$'(1/2) as already constructed on [0,1/2].
I'm pretty sure this sequence of functions will converge to f. Whether you can uniformly bound the second derivative I do not know; but at least you are dealing with 3rd degree polynomials, so you can work on it.