This is going to be a very long answer but I wanted to make it as self-contained as possible, so bear with me here. I promise by the end it will be painfully clear what $g(P, Q)$ is for any tensor fields $P, Q$ of type $(a, b)$ and how $\nabla^k f$ is a $(0, k)$ tensor. As you'll see, $\nabla^k f$ is not a vector field (for all $k \neq 1$) nor can it be reasonably interpreted that way.
First, we define the covariant derivative of a $1$-form $\omega$ along a vector field $X$ as the $1$-form $\nabla_X \omega$ determined by
$$\nabla_X [\omega(Y) ] = (\nabla_X \omega)(Y) + \omega(\nabla_X Y), \ \forall Y \in \Gamma(T \mathcal{M})$$
Now, let $T$ be a $(k, \ell)$ tensor field (i.e, it takes $k$ differential forms of degree $1$, $\ell$ vector fields and outputs a real smooth function) on a Riemannian manifold $(\mathcal{M}, g)$ with Levi-Civita connection $\nabla$. I'll denote the space of all such tensor fields by $ \newcommand{\mm}{\mathcal{M}} \newcommand{\T}{\mathscr{T}} \T^{k}_{\ell}(T \mm)$. We define the covariant derivative of $T$ along the vector field $X$ as the $(k, \ell)$ tensor field determined by
\begin{aligned}
(\nabla_X T)(\omega^1, \cdots, \omega^{k}, X_1 ,\cdots, X_{\ell}) &= X\left(T(\omega^1, \cdots, \omega^{k}, X_1 ,\cdots, X_{\ell}) \right) \\
&-\sum_{1 \leq i \leq \ell} T\left( \omega^1, \cdots, \omega^{k}, X_1, \cdots, \nabla_X X_i, \cdots, X_{\ell} , \right) \\
&-\sum_{1 \leq j \leq k} T\left(\omega^1, \cdots, \nabla_X \omega^{j}, \cdots \omega^{k}, X_1, \cdots, X_{\ell}\right)
\end{aligned}
for all $\newcommand{\mm}{\mathcal{M}} T \newcommand{\T}{\mathscr{T}} \in \T^{k}_{\ell}(T \mm)$, $\{X_i \}_{1 \leq i \leq k} \subset \Gamma(T \mm)$ and $\{\omega^j \}_{1 \leq j \leq \ell} \subset \Gamma(T^{*} \mm)$. These definitions do have an intutive motivation behind them (we can require the extension of $\nabla$ to each bundle of $(k, \ell)$ tensors on $M$ to satisfy certain very reasonable properties and then prove that these properties completely determine $\nabla$ in the way I've defined them now - you can see this approach on John Lee's Riemannian geometry book).
So we may think of $\nabla$ as a map
\begin{aligned}
\nabla: \Gamma(T \mm) \times \T^{k}_{\ell}(T \mm) &\to \T^{k}_{\ell}(T \mm) \\
(X, T) &\mapsto \nabla_X T
\end{aligned}
or as a map (which we'll call the total covariant derivative)
\begin{aligned}
\nabla: \T^{0}_{\ell}(T \mm) &\to \T^{0}_{\ell + 1}(T \mm) \\
T &\mapsto \nabla T
\end{aligned}
where we're now (for the sake of simplicity) restricting ourselves to tensors of type $(0, \ell)$ (or $(1, \ell)$ too, which can be identified with multilinear maps which take $\ell$ vector fields and output a single vector field), and $\nabla T$ is the $(0, \ell + 1)$ (resp. $(1, \ell + 1)$) given by
$$(\nabla T)(X, Y_1, \cdots, Y_{\ell}) = (\nabla_X T)(Y_1, \cdots, Y_k)$$
for all $X, Y_1, \cdots, Y_{\ell} \in \Gamma(T \mm)$. Adopting the very reasonable convention that $(0, 0)$ tensor fields are just smooth real functions, we can then take an arbitrary real smooth function $f$ and define $\nabla f$ as the $(0, 1)$ tensor field given by
$$(\nabla f)(X) = X(f)$$
Since $\nabla f \doteq T$ is a $(0, 1)$ tensor field, we can now talk about its total covariant derivative, which we'll naturally call the second total covariant derivative of $f$. And what is $\nabla T$? Well, as we just defined it, we see that it is given by:
\begin{aligned}
\nabla^2 f : \Gamma(T \mm) \times \Gamma(T \mm) &\to \mathcal{C}^{\infty}(\mm) \\
(X, Y) &\mapsto (\nabla^2 f)(X, Y) = [\nabla(\nabla f)](X, Y)
\end{aligned}
where
\begin{aligned}
(\nabla^2 f)(X, Y) &= [\nabla_Y (\nabla f)](X) \\
&= \nabla_Y[\nabla_X f] - (\nabla f)(\nabla_Y X) \\
&= Y(X(f)) - \nabla_{\nabla_Y X} f
\end{aligned}
The map $\nabla^2 f$ is called the Hessian of $f$. A simple calculation shows that it is a symmetric bilinear form (equvivalently, when seen as a $(1, 1)$ tensor it is self adjoint). Since $\nabla^2 f$ is a $(0, 2)$ tensor, we can then talk about its total covariant derivative $\nabla^3 f = \nabla(\nabla^2 f)$. By now you see where this is going: we inductively define $\nabla^k f = \nabla(\nabla^{k-1} f)$. Of course a very similar construction can be made for tensors, but there's no need to get into that now since you only ask about smooth functions (for completeness' sake, however, and also because I haven't seen the following computation anywhere else, I'll talk about the inner product of general tensors).
Let us now fix a chart $\varphi: U \subset \mm^n \to \mathbb{R}^n$ around a point $p \in \mm$, which (for each $1 \leq i \leq n$) induces the following local sections of $\Gamma(T U)$ and $\Gamma(T^{*} U)$:
\begin{aligned}
\frac{\partial}{\partial x^{i}} :U &\to \Gamma(TU) \\
q \in U &\mapsto \left.\frac{\partial}{\partial x^{i}} \right\vert_q \in T_q U
\end{aligned}
and
\begin{aligned}
\newcommand{\dx}{\mathrm{d}x}
\dx^{i} :U &\to \Gamma(T^{*}U) \\
q \in U &\mapsto \left.\dx^{i}\right\vert_{q} \in T_q^{*}U
\end{aligned}
where $\left.\dx^{i}\right\vert_{q}$ is determined by $$\left.\dx^{i}\right\vert_{q}\left( \left.\frac{\partial}{\partial x^{j}} \right\vert_q \right) = \delta^{i}_{j}$$
Recall now the musical isomorphisms $\flat: \Gamma(T \mm) \to \Gamma(T^{*} \mm)$ and $\sharp: \Gamma(T^{*} \mm) \to \Gamma(T \mm)$, where $\flat(X) = g(X, \bullet)$ and $\sharp = \left(\flat \right)^{-1}$. We can define the inner product of differential forms of degree $1$ by declaring that:
$$g(\omega_1, \omega_2) \doteq g\left((\omega_1)^{\sharp}, (\omega_2)^{\sharp} \right)$$
Of course the left hand side of the expression above doesn't make sense a priori, but the right hand side does, because $(\omega_1)^{\sharp}$ and $(\omega_2)^{\sharp}$ sharp are both vector fields, which the metric takes as inputs. Notice that this definition is also coordinate free. Therefore the inner product of $1$-forms is well defined.
Now, if $P$ is an $(a, b)$ tensor field, it's simple to prove that the following holds on any $q \in U$:
$$P(q) = P^{j_1 \cdots j_a}_{ i_1 \cdots i_b} (q) \cdot \left.\frac{\partial}{\partial x^{j_1}} \right\vert_q \otimes \left.\frac{\partial}{\partial x^{j_2}} \right\vert_q \otimes \cdots \otimes \left.\frac{\partial}{\partial x^{j_a}} \right\vert_q \otimes \left.\dx^{i_1}\right\vert_{q} \otimes \left.\dx^{i_2}\right\vert_{q} \otimes \cdots \otimes \left.\dx^{i_b}\right\vert_{q} $$
where we're now using Einstein notation. Let $Q$ be yet another $(a, b)$ tensor field. Mutatis mutandis,
$$Q(x) = Q^{r_1 \cdots r_a}_{m_1 \cdots m_b} (x) \cdot \left.\frac{\partial}{\partial x^{r_1}} \right\vert_x \otimes \left.\frac{\partial}{\partial x^{r_2}} \right\vert_x \otimes \cdots \otimes \left.\frac{\partial}{\partial x^{r_a}} \right\vert_x \otimes \left.\dx^{m_1}\right\vert_{x} \otimes \left.\dx^{m_2}\right\vert_{x} \otimes \cdots \otimes \left.\dx^{m_b}\right\vert_{x} , \ \forall x \in U$$
We can now define the inner product of $P$ and $Q$ at $p$ as
$$\langle P(p), Q(p) \rangle \doteq P^{j_1 \cdots j_a}_{ i_1 \cdots i_b} (p) Q^{r_1 \cdots r_a}_{m_1 \cdots m_b} (p) \left\langle \left.\frac{\partial}{\partial x^{j_1}} \right\vert_p, \left.\frac{\partial}{\partial x^{r_1}} \right\vert_p \right\rangle \cdots \left\langle \left.\frac{\partial}{\partial x^{j_a}} \right\vert_p, \left.\frac{\partial}{\partial x^{r_a}} \right\vert_p \right\rangle \left\langle \left.\dx^{i_1}\right\vert_{p}, \left.\dx^{m_1}\right\vert_{p} \right\rangle \cdots \left\langle \left.\dx^{i_b}\right\vert_{p}, \left.\dx^{m_b}\right\vert_{p} \right\rangle $$
For convenience, we'll now omit the points and use the notation:
$$\left.\frac{\partial}{\partial x^{j_k}} \right\vert_p = \partial_k$$ and $$\left.\dx^{j_k}\right\vert_{p} = \partial^k $$
Now, by definition $$\langle \partial^{i_k}, \partial^{m_k} \rangle = \langle \left( \partial^{i_k} \right)^{\sharp}, \left( \partial^{m_k} \right)^{\sharp} \rangle $$
A straightforward computation shows that $\left( \partial^{i_k} \right)^{\sharp} = g^{i_k \ell} \partial_{\ell}$. Then we see that $$\langle \partial^{i_k}, \partial^{m_k} \rangle = g^{i_k m_k}$$
and thus our definition for the inner product of $P$ and $Q$ may be written as
$$\langle P, Q \rangle = g_{j_1 r_1} \cdots g_{j_a r_a} g^{i_1 m_1} \cdots g^{i_b m_b} P^{j_1 \cdots j_a}_{i_1 \cdots i_b} Q^{r_1 \cdots r_a}_{m_1 \cdots m_b}$$
And at this point you might rightfully complain $\langle P, Q \rangle$ is not actually well defined: what if we use another chart $\psi: V \subset \mm \to \mathbb{R}^n$, which induces a different local frame and local co-frame? Let's call these $\widetilde{\partial}_i$ and $\widetilde{\partial}^i$ (where of course $i$ runs through $\{1, \cdots, n\}$). So let's show it's actually well defined. Denoting by $\widetilde{T}_{i_1 \cdots i_b}^{j_1 \cdots j_a}$ the components of a tensor $T$ in this new chart $\psi$, what we want to establish is that:
$$ g_{j_1 r_1} \cdots g_{j_a r_a} g^{i_1 m_1} \cdots g^{i_b m_b} P^{j_1 \cdots j_a}_{i_1 \cdots i_b} Q^{r_1 \cdots r_a}_{m_1 \cdots m_b} = \widetilde{g}_{\mu_{j_1} \mu_{r_1}} \cdots \widetilde{g}_{\mu_{j_a} \mu_{r_a}} \widetilde{g}^{\theta_{i_1} \theta_{m_1}} \cdots \widetilde{g}^{\theta_{i_b} \theta_{m_b}} \widetilde{P}^{\mu_{j_1} \cdots \mu_{j_a}}_{\theta_{i_1} \cdots \theta_{i_b}} \widetilde{Q}^{\mu_{r_1} \cdots \mu_{r_a}}_{\theta_{m_1} \cdots \theta_{m_b}}$$
Let's call the left-hand side of the above expression $A$ and the right-hand side $B$. Notice that for each $k$, we can write:
$$\partial_{j_{k}} = \widetilde{\partial}^{\mu_{j_k}}(\partial_{j_{k}})\widetilde{\partial}_{\mu_{j_k}}$$
so the expression
$$A_1 \doteq g_{j_1 r_1} \cdots g_{j_a r_a} $$
is actually equal to
$$A_1 = \widetilde{\partial}^{\mu_{j_1}}(\partial_{j_1}) \widetilde{\partial}^{\mu_{r_1}}(\partial_{j_1}) \cdots \widetilde{\partial}^{\mu_{j_a}}(\partial_{j_a}) \widetilde{\partial}^{\mu_{r_a}}(\partial_{r_a}) \widetilde{g}_{\mu_{j_1} \mu_{r_1}} \cdots \widetilde{g}_{\mu_{j_a} \mu_{r_a}} $$
Similarly, writing
$$\partial^{j_k} = \partial^{j_k}(\widetilde{\partial}_{\theta_{j_k}}) \widetilde{\partial}^{\theta_{j_k}}$$
the expression
$$A_2 \doteq g^{i_1 m_1} \cdots g^{i_b m_b}$$
can be written as
$$ \partial^{i_1}(\widetilde{\partial}_{\theta_{i_1}}) \partial^{m_1}(\widetilde{\partial}_{\theta_{m_1}}) \cdots \partial^{i_b}(\widetilde{\partial}_{\theta_{i_b}}) \partial^{m_b}(\widetilde{\partial}_{\theta_{m_b}}) \widetilde{g}^{\theta_{i_1} \theta_{m_1}} \cdots \widetilde{g}^{\theta_{i_b} \theta_{m_b}}$$
And the expression
$$A_3 \doteq P^{j_1 \cdots j_a}_{ i_1 \cdots i_b}$$
can be written as
$$\partial^{j_1}(\widetilde{\partial}_{\beta_{j_1}}) \cdots \partial^{j_a}(\widetilde{\partial}_{\beta_{j_a}}) \widetilde{\partial}^{\lambda_{i_1}}(\partial_{i_1}) \cdots \widetilde{\partial}^{\lambda_{i_b}}(\partial_{i_b}) \widetilde{P}^{\beta_{j_1} \cdots \beta_{j_a}}_{\lambda_{i_1} \cdots \lambda_{i_b}}$$
Finally, the expression
$$A_4 \doteq Q^{r_1 \cdots r_a}_{m_1 \cdots m_b}$$
can be written as
$$A_4 = \partial^{r_1}(\widetilde{\partial}_{\xi_{r_1}})\widetilde{\partial}^{\xi_{r_1}} \cdots \partial^{r_a}(\widetilde{\partial}_{\xi_{r_a}})\widetilde{\partial}^{\xi_{r_a}} \widetilde{\partial}^{\eta_{m_1}}(\partial_{m_1}) \cdots \widetilde{\partial}^{\eta_{m_b}}(\partial_{m_b}) \widetilde{Q}^{\xi_{r_1} \cdots \xi_{r_a}}_{\eta_{m_1} \cdots \eta_{m_b}}$$
Grouping terms conveniently, we see that
$$ \begin{aligned}
A &= \left( \prod_{1 \leq k \leq a} \widetilde{\partial}^{\mu_{j_k}} (\partial_{j_k}) \partial^{j_k}(\widetilde{\partial}_{\beta_{j_k}}) \right) \cdot \left( \prod_{1 \leq k \leq a} \widetilde{\partial}^{\mu_{r_k}}(\partial_{r_k}) \partial^{r_k}(\widetilde{\partial}_{\xi_{r_k}}) \right) \cdot \left(\prod_{1 \leq k \leq b} \widetilde{\partial}^{\lambda_{i_k}}(\partial_{i_k}) \partial^{i_k}(\widetilde{\partial}_{\theta_{i_k}})\right) \cdot \left(\prod_{1 \leq k \leq b} \widetilde{\partial}^{\eta_{m_k}}(\partial_{m_k}) \partial^{m_k}(\widetilde{\partial}_{\theta_{m_k}}) \right) \cdot \widetilde{g}_{\mu_{j_1} \mu_{r_1}} \cdots \widetilde{g}_{\mu_{j_a} \mu_{r_a}} \widetilde{g}^{\theta_{i_1} \theta_{m_1}} \cdots \widetilde{g}^{\theta_{i_b} \theta_{m_b}} \cdot \widetilde{P}^{\beta_{j_1} \cdots \beta_{j_a}}_{\lambda_{i_1} \cdots \lambda_{i_b}} \widetilde{Q}^{\xi_{r_1} \cdots \xi_{r_a}}_{\eta_{m_1} \cdots \eta_{m_b}} \\
&= \left(\prod_{1 \leq k \leq a} \widetilde{\partial}^{\mu_{j_k}} (\partial^{j_k} (\widetilde{\partial}_{\beta_{j_k}}) \partial_{j_k}) \right) \cdot \left(\prod_{1 \leq k \leq a} \widetilde{\partial}^{\mu_{r_k}}( \partial^{r_k}( \widetilde{\partial}_{\xi_{r_k}}) \partial_{r_k} ) \right) \cdot \left( \prod_{1 \leq k \leq b} \widetilde{\partial}^{\lambda_{i_k}} ( \partial^{i_k}( \widetilde{\partial}_{\theta_{i_k}} ) \partial_{i_k} ) \right) \cdot \left(\prod_{1 \leq k \leq b} \widetilde{\partial}^{\eta_{m_k}}(\partial^{m_k} (\widetilde{\partial}_{\theta_{m_k}} ) \partial_{m_k} ) \right) \widetilde{g}_{\mu_{j_1} \mu_{r_1}} \cdots \widetilde{g}_{\mu_{j_a} \mu_{r_a}} \widetilde{g}^{\theta_{i_1} \theta_{m_1}} \cdots \widetilde{g}^{\theta_{i_b} \theta_{m_b}} \widetilde{P}^{\beta_{j_1} \cdots \beta_{j_a}}_{\lambda_{i_1} \cdots \lambda_{i_b}} \widetilde{Q}^{\xi_{r_1} \cdots \xi_{r_a}}_{\eta_{m_1} \cdots \eta_{m_b}} \\
&= \left(\prod_{1 \leq k \leq a} \widetilde{\partial}^{\mu_{j_k}}(\widetilde{\partial}_{\beta_{j_k}}) \right) \cdot \left(\prod_{1 \leq k \leq a} \widetilde{\partial}^{\mu_{r_k}}(\widetilde{\partial}_{\xi_{r_k}}) \right) \cdot \left(\prod_{1 \leq k \leq b} \widetilde{\partial}^{\lambda_{i_k}}(\widetilde{\partial}_{\theta_{i_k}}) \right) \cdot \left(\prod_{1 \leq k \leq b} \widetilde{\partial}^{\eta_{m_k}}(\widetilde{\partial}_{\theta_{m_k}}) \right) \\
&\cdot \widetilde{g}_{\mu_{j_1} \mu_{r_1}} \cdots \widetilde{g}_{\mu_{j_a} \mu_{r_a}} \cdot \widetilde{g}^{\theta_{i_1} \theta_{m_1}} \cdots \widetilde{g}^{\theta_{i_b} \theta_{m_b}} \widetilde{P}^{\beta_{j_1} \cdots \beta_{j_a}}_{\lambda_{i_1} \cdots \lambda_{i_b}} \widetilde{Q}^{\xi_{r_1} \cdots \xi_{r_a}}_{\eta_{m_1} \cdots \eta_{m_b}} \\
&= \left( \prod_{1 \leq k \leq a} \delta^{\mu_{j_k}}_{\beta_{j_k}}\right) \cdot \left( \prod_{1 \leq k \leq a} \delta^{\mu_{r_k}}_{\xi_{r_k}}\right) \cdot \left( \prod_{1 \leq k \leq b} \delta^{\lambda_{i_k}}_{\theta_{i_k}}\right) \cdot \left( \prod_{1 \leq k \leq b} \delta^{\eta_{m_k}}_{\theta_{m_k}}\right) \\
&\cdot \cdot \widetilde{g}_{\mu_{j_1} \mu_{r_1}} \cdots \widetilde{g}_{\mu_{j_a} \mu_{r_a}} \cdot \widetilde{g}^{\theta_{i_1} \theta_{m_1}} \cdots \widetilde{g}^{\theta_{i_b} \theta_{m_b}} \widetilde{P}^{\beta_{j_1} \cdots \beta_{j_a}}_{\lambda_{i_1} \cdots \lambda_{i_b}} \widetilde{Q}^{\xi_{r_1} \cdots \xi_{r_a}}_{\eta_{m_1} \cdots \eta_{m_b}} \\
&= \widetilde{g}_{\mu_{j_1} \mu_{r_1}} \cdots \widetilde{g}_{\mu_{j_a} \mu_{r_a}} \widetilde{g}^{\theta_{i_1} \theta_{m_1}} \cdots \widetilde{g}^{\theta_{i_b} \theta_{m_b}} \widetilde{P}^{\mu_{j_1} \cdots \mu_{j_a}}_{\theta_{i_1} \cdots \theta_{i_b}} \widetilde{Q}^{\mu_{r_1} \cdots \mu_{r_a}}_{\theta_{m_1} \cdots \theta_{m_b}} \\
&= B
\end{aligned}
$$
as desired. Thefore $g(P, Q)$ is indeed well defined.