Usually it will not matter in the slighlest.
Take Tapu-Lele,
I just built a team of lv30-35 Roserades of random IV. They could comfortably do a duo. The cost is zero stardust and zero rare candy.
The optimal team of Mega, shadow, perfect IV and level 50 pokemon can’t solo a Tapu-Lele. The only difference is they will have some more seconds left in a duo.
The only thing you will get is a larger chance of being listed as “most damage” (useless) and occasionally one more ball for individual damage (if you have everything to 50 you will not care).
The cost however is huge, finding good IV shadows, gathering the XL to take them to 50, raiding the megas for energy, catching bad pokemon for stardust…
In terms of this game once you have a team of 6/12 of decent counters of each type powered to 35-40 you can consider you “finished the PVE game” after that all you do is fine tune (at a huge expense) your counters for marginal gains.