Why is this function computable in polynomial time? Given alphabet $\{0,1\}$, I read that the following function $f$ is computable in polynomial time relative to input $w$

$$
f(w) = w10^{|w|^2-|w|-1}
$$

i.e. $f$ can be a $TM$ that receives $w$ and outputs $w10^{|w|^2-|w|-1}$. But why is it computable in polynomial time when it has a component $0^{g(w)}$ for $g(w)=|w|^2-|w|-1$?, i.e. the size of the input is in the exponent part.
What $0^{|w|^2-|w|-1}$ is? It is "$0$" symbol repeated $|w|^2-|w|-1$ times. What is time complexity of simply outputting $0$ $|w|^2-|w|-1$ times? Clearly it is $|w|^2-|w|-1$, what is $O(|w|^2)$, i.e. polynomial of length of input.