which should not be possible.
Indeed, uniform coordinate acceleration $a$ is inconsistent with special relativity however, uniform proper acceleration $\alpha$ is consistent.
The proper acceleration is the acceleration of the object according to an attached accelerometer.
For 1D motion, the relationship between $\alpha$ and $a$ is given by
$$\alpha = \gamma^3 a = \frac{a}{\left( 1 - \frac{v^2}{c^2} \right)^{\frac{3}{2}} }$$
Since the Lorentz factor goes to infinity as $v \rightarrow c$, $a$ must go to zero if $\alpha$ is to remain finite.
If, from an inertial reference frame, an object were observed to have uniform coordinate acceleration $a$, the object's proper acceleration would be arbitrarily large as the object's speed approached $c$ in this frame.
Is there some other formula that gives the position of an object
depending on its acceleration and on the time, but which works and
does not allow the speed of the object to surpass the speed of light?
In the context of special relativity, one must be careful to distinguish between the proper and coordinate accelerations since, as described in the link above, they are not the same thing.
Assuming by, "its acceleration", you mean its (constant) proper acceleration, then, with zero initial conditions, the formula is
$$x(t) = \frac{c^2}{\alpha}\left[\sqrt{1 + \frac{\alpha^2 t^2}{c^2}}-1 \right]\;,\; t \ge 0$$
See that, as $t$ gets very large, $x(t)$ asymptotically approaches $ct$, i.e., the speed asymptotically approaches $c$.