Here's an example anydice program which calculates the difference between the two styles of attack for a combatant using a glaive:
function: attack ATTACK:n AMOD:n AC:n DMG:d CRIT:d {
if ATTACK = 20 { result: DMG + CRIT }
if ATTACK + AMOD >= AC { result: DMG }
result: 0
}
output [attack 1@2d20 10 16 1d10+13 1d10] named "Glaive normal"
output [attack 1@2d20 5 16 1d10+23 1d10] named "Glaive GWF"
output [attack 1@2d20 5 16 1d10+23 1d10] - [attack 1@2d20 10 16 1d10+13 1d10] named "difference"
The way this works is that we define a function to calculate the results of an attack roll with the given parameters, and then invoke that function to compare the different scenarios. The function itself expects to be provided a d20 roll for attack, the attack's modifier, the target's AC, the damage done on a hit and the extra damage dealt by a crit.
Since you didn't specify which weapon you were using (but you mentioned polearm mastery), in this example I've chosen to use a glaive - you can obviously change those values as appropriate, and the choice of weapon is important, because the lower the base damage, the more significant the effect of GWF becomes. Your advantage is covered by rolling 2d20 and selecting the first die of the set using the 1@2d20
syntax, since anydice sorts rolled dice in descending order by default (this is functionally equivalent to using [highest 1 of 2d20]
or [highest of 1d20 and 1d20]
).

We can see from the resulting tables and graphs that the expected damage when using GWF in these circumstances is about 4 points better than not - but you're also significantly more likely to whiff completely when using GWF. For this hypothetical glaive wielder against the AC 16 foe, they're going to average better damage by using GWF than not.
GWF becomes less advantageous to use when you're doing more base damage, since as your base damage increases, the increased risk of missing entirely starts to offset the gain in expected damage. It also provides less benefit as your odds of hitting overall decrease, for the same reason - the turning point in this example is AC 19, at which point GWF style becomes a net negative. If you didn't have advantage on the attack, that drops to AC 17. Obviously, you can experiment with that by putting your own values in the script.
The other benefit of GWF, the bonus attack if you crit/drop an enemy to 0hp, doesn't influence whether or not you should use GWF if you have it, because you get that bonus attack regardless of whether you're currently using the damage bonus.
Once you've got Polearm Master, it might sometimes be the case that your optimal strategy is to make normal attacks with your Attack action but to use GWF on your bonus action Polearm Master attack, since it has a considerably lower base damage. The same might apply to additional attacks you get to make using Extra Attack or the GWF bonus attack, as some of your damage comes from features you can only use once a turn, so the calculation for those other attacks will be slightly different. Luckily you can choose whether or not to use the GWF bonus/penalty on each attack you make individually, rather than having to declare and then stick with it on all your attacks.