I wonder, is there an elementary or other closed-form function $g(q)$ which behaves like $$f(q)=\sum_{p\in\mathbb{P}} q^p$$ near $q=1$?
The plot of $f(q)$ looks like the following, but I failed to find an elementary function with a similar behavior near $q=1$:

Here’s a perhaps slightly more pedestrian solution that leads to the concrete asymptotic behaviour of your function.
As $q\to1$, your sum averages over more and more primes, so asymptotically it doesn’t depend on the details of the distribution of the primes. Thus, we can replace the sum over the primes by an integral over their density $\frac1{\log p}$:
$$ \sum_pq^p\sim\int_a^\infty q^p\frac{\mathrm dp}{\log p}\;, $$
where I left the lower limit $a$ unspecified; it doesn’t matter asymptotically and will drop out in due course. Now set $q=1-\epsilon$ to find
\begin{eqnarray} \int_a^\infty q^p\frac{\mathrm dp}{\log p} &=& \int_a^\infty(1-\epsilon)^p\frac{\mathrm dp}{\log p} \\ &=& \int_a^\infty\mathrm e^{p\log(1-\epsilon)}\frac{\mathrm dp}{\log p} \\ &\sim& \int_a^\infty\mathrm e^{-\epsilon p}\frac{\mathrm dp}{\log p} \\ &=& \int_{\epsilon a}^\infty\mathrm e^{-x}\frac{\mathrm dx}{\epsilon\log\frac x\epsilon} \\ &=& \frac1\epsilon\int_{\epsilon a}^\infty\mathrm e^{-x}\frac{\mathrm dx}{\log x-\log\epsilon} \\ &=& -\frac1{\epsilon\log\epsilon}\left(\int_0^\infty\mathrm e^{-x}\mathrm dx+\frac1{\log\epsilon}\int_0^\infty\mathrm e^{-x}\log x\mathrm dx+O\left(\frac1{\log^2\epsilon}\right)\right) \\ &=& -\frac1{\epsilon\log\epsilon}\left(1-\frac{\gamma}{\log\epsilon}+O\left(\frac1{\log^2\epsilon}\right)\right)\;, \end{eqnarray}
where $\gamma$ is the Euler–Mascheroni constant. Thus
$$ \sum_pq^p\sim-\frac1{(1-q)\log(1-q)}\;. $$
To visualize the asymptotic behaviour, we can look at the reciprocal of your function:
\begin{eqnarray} \left(\sum_pq^p\right)^{-1} &=& -\epsilon\log\epsilon\left(1-\frac{\gamma}{\log\epsilon}+O\left(\frac1{\log^2\epsilon}\right)\right)^{-1}\;, \\ &=& -\epsilon\left(\log\epsilon+\gamma+O\left(\frac1{\log\epsilon}\right)\right)^{-1}\;. \end{eqnarray}
This shows why I carried along the term in $\epsilon\log^{-2}\epsilon$, even though it’s not part of the leading asymptotic behaviour, as it leads to a term linear in $\epsilon$ in the reciprocal that we need for a good comparison.
Here’s a graph of the reciprocal of your function (in purple) compared to $-(1-q)(\log(1-q)+\gamma)$ (in green):