Base Damage (at Level 1):
- Without GWF, d12 has 1/12 chance of base damage 1 through 12, so each round is 1d12 + Strength Mod or 6.5 + 4 = 10.5 avg DPR.
- With GWF, rollin a 1 or 2 triggers a re-roll, returning on average 6.5. (I was initially confused about how to calculate this, so I had to ask this math.se question) Replacing those results with their average returns gives an average damage roll of 7.33, so:
GWF, STR 18 (mod 4) yields 7.33 + 4 = 11.33 avg DPR.
As Spear Carrier pointed out, using a 2d6 weapon synergises better with GWF as there are twice as many chances to get a re-roll. This brings the Greatsword's average damage up to 8.33, which gives 12.33 when STR Mod is added.
- Without TWF, d6 has 1/6 chance of base damage 1 through 6, so with two attacks, each round is (1d6 * 2) + Strength Mod or (3.5 * 2) + 4 = 11 avg DPR.
- With TWF you get to add the ability modifier twice, so:
- TWF, STR 18 (mod 4) yields (3.5 + 4) * 2 = 15 avg DPR.
Basically TWF lowers your base weapon damage, but gives you 1 extra full attack action for the price of your bonus action. Before 5th level, this makes a considerable difference, especially if you're looking for crits, due to the extra attack roll (though at low levels your build probably isn't optimized that much for crit-fishing).
Charts to lay out average DPR:
Assuming you're not going to get more damage out of a bonus action (which Eldritch Knight's War Magic (PHB p. 75) might give you, or some of the Battle Master maneuvers (PHB p. 74), for example) it scales like this:
As you can see, even without magic weapons, TWF is easily in the lead before level 5, and then still out-performs the greataxe with anything better than just the STR Mod from a score of 18. But because the only thing TWF gives you that scales is one extra use of your modifier, it's got to be high to offset the extra (greater) weapon damage that great weapons give on each attack once we start stacking more attacks on.
Getting TWF to beat GWF at Level 20
Once you get 4 attacks per turn at level 20, even without GWF a Greatsword outperforms two Shortswords with TWF until the modifier reaches+10 - that's a +3 magic weapon (DMG p.213) and a Belt of Fire Giant Strength! (DMG p.155) Make it a Belt of Storm Giant Strength and you can beat the Greataxe with GWF due to a combined modifier of +12, but to beat the GWF Greatsword you'd need a whopping +16, and I'm not sure where you'd get that:
Of course, before Level 11 a total modifier of 7 is enough for TWF to stay in front, and even then they tie at 58 Avg DPR with a modifier of 11 - tough, but doable. More than that and TWF pulls ahead again for 19 full levels.
Spear Carrier's answer referred to Flame Tongue weapons (DMG p.170) as a way of helping TWF's viability, which intrigued me: that doesn't add to your bonus, but rather stacks on extra (fire) damage die. So I decided to check it out and see how far it got you. Assuming a Flame Tongue weapon is available to either party, it doesn't do a lot, though - at level 20 you still need a total modifier of 15, which I'm pretty sure can't be achieved with official material. (Basically it amounts to adding 7 average damage per attack for both builds.)
The only reason I can imagine going for TWF for a L20 Fighter if optimization is what you're after is if you're going crit fishing, and that one extra attack might land it for you. Even then, though, you're losing that bonus action that a Battle Master or Eldritch Knight could use to add more damage every time, rather than just 3/20 of the time, and GWF only needs 1 magic weapon, leaving an extra attunement slot.
Thanks András and Protonflux for pointing out my calculation errors in an earlier edit!