Add a deterministic function to a stochastic process in order to get a martingale

I was wondering if there were a way to transform the process $$X(t) = w^4(t)$$ with $$w(t)$$ which is a standard Brownian motion, into a martingale, by adding a deterministic function. That is: $$Y(t) = w^4(t) + g(t)$$ with g(t) that is a deterministic function.

I tried to apply Ito's Lemma on $$Y(t)$$ in order to derive a condition on the term associated with $$dt$$ (which is equal to 0 for a martingale) but this leads to this condition:

$$\frac{dg}{dt} = -12w^2(t)$$ which does not seem to help much.

What I also know is that $$E[w^4(t)] = 3t^2$$ but removing this quantity from $$X(t)$$ does not give a martingale either.

No, there isn't. Your argument by Itô's lemma is sufficient (in fact, you can apply Itô's lemma to $$W_t^4$$ directly and get the same result). Here's an alternative argument you might be interested in.
Consider the martingale $$M_t = W_t^2 - t$$ and set $$R_t = M_t^2 = W_t^4 - 2t W_t^2 +t^2$$. By definition, the quadratic variation of $$M_t$$, $$\langle M \rangle_t$$, is the unique process such that $$M_t^2 - \langle M \rangle_t$$ is again a martingale. Let's compute $$\langle M \rangle_t$$: first note that $$dM_t = 2W_tdW_t$$, so that $$(dM_t)^2 = 4W_t^2 dt$$, giving us that $$\langle M \rangle_t = \int_0^t 4W_s^2 ds$$ Thus, $$M_t^2 - \langle M \rangle_t = W_t^4 - 2t W_t^2 +t^2 - \int_0^t 4W_s^2 ds$$ is a martingale, but the compensator $$- 2t W_t^2 +t^2 - \int_0^t 4W_s^2 ds$$ is not deterministic.