This question was addressed in higher dimensions by Mike Freedman, Surgery on codimension 2 submanifolds. Mem. Amer. Math. Soc. 12 (1977), no. 191. (I think this was his PhD thesis.) Earlier work of Thomas and Wood (On manifolds representing homology classes in codimension 2.
Invent. Math. 25 (1974), 63–89) had given some bounds for the homological complexity of codimension-2 submanifolds, generalizing those given by Hsiang and Szczarba for surfaces in 4-manifolds. My recollection is that Freedman shows that the Thomas-Wood bounds are close to optimal. The technique is a very clever variation of surgery theory, rather different from the typical uses of surgery theory in constructing embeddings in higher codimensions.
I think the upshot of Freedman's work is that the analogue of the Thom conjecture in higher dimensions does not hold.
Update 9/15/21: After this MO exchange, we started discussing how to reduce $b_2$ for the degree $d$ hypersurface $V_d$ in $CP^3$. In recent preprint (On the Thom conjecture in $CP^3$), Marko (the OP), Sašo Strle, and I showed that when $d \geq 5$, there is a smooth $4$-manifold in the homology class of $V_d$ with strictly smaller $b_2$. So the analogue of the Thom conjecture doesn't hold in $CP^3$ either. (As noted in my comment below, it does actually hold for $d \leq 4$.)
It's likely that our construction doesn't produce the smallest possible $b_2$ so there is still some room for improvement.