As far as I understand, what you call $f_P$ is usually called monomial symmetric function as is denoted $m_P$. So I interpret your question as asking for an algorithm converting monomial symmetric funtion to power sum symmetric function. There is such an algorithm here
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4656270/
Also there is one which was implemented in Symmetrica more than twenty years ago. I don't think the algorithm was documented anywhere but as a comment in the code tmp.c
. The comment seems to indicate that they use a recursive divide and conquer method using the following recursion step:
$$ m_{a_1,a_2,...,a_n,a_{n+1},...a_{2n}} = m_{a_1,...,a_n} * m_{a_{n+1},..,a_{2n}} - \text{terms of length} <2n $$
Anyway, unless you really need to say something about the algorithm, I would recommend using a computed algebra system which already has this algorithm implemented.