I will make a build under the assumption that the primary objectives are to maximize the character's ability to successfully grapple and maximize the amount of time the character can prevent a grappled creature from escaping.
Per Grappling (PHB page 195),
...you can use the Attack action to make a special melee attack, a grapple. If you’re able to make multiple attacks with the Attack action, this attack replaces one of them. The target of your grapple must be no more than one size larger than you, and it must be within your reach. Using at least one free hand, you try to seize the target by making ... a Strength (Athletics) check contested by the target’s Strength (Athletics) or Dexterity (Acrobatics) check (the target chooses the ability to use). If you succeed, you subject the target to the grappled condition (see appendix A). ... Escaping a Grapple. A grappled creature can use its action to escape. To do so, it must succeed on a Strength (Athletics) or Dexterity (Acrobatics) check contested by your Strength (Athletics) check.
So we essentially want to maximize our Strength (Athletics) while minimizing our opponent's Strength (Athletics) and Dexterity (Acrobatics) checks. In addition, if we can ever prevent our grappled creature from taking an action, we prevent them from having a chance to escape. I will also interpret "this attack replaces one of them" to mean that, should we have two attacks in a turn (such as with Extra Attack), only one of them can be used to attempt to grapple, and we can't make two grapple attempts on the same turn.
Also, for ease of math, I will assume that advantage will be equivalent to +5, and disadvantage equivalent to -5, like the mechanic for passive checks on page 175 of the PHB. I will also assume that we don't have disadvantage during any grapple check, and that we are using a luck point.
Race
Variant Human, with the Lucky Feat,
You have 3 luck points. Whenever you make an attack roll, an ability check, or a saving throw, you can spend one luck point to roll an additional d20.
This is effectively advantage, so we will gain a +5 bonus to our Athletics check if we use a luck point.
Background
For our Background, we will just want something that grants us proficiency in Athletics: Outlander, Sailor, or Soldier. They are all equivalent for our build.
Ability Scores
I will assume 27 point buy for ability scores, as described on page 13 of the PHB.
STR: 15 (for Athletics)
DEX: 13 (for Rogue multiclass)
CON: 14 (for HP)
INT: 8
WIS: 9 (interchangeable with INT)
CHA: 13 (for Bard multiclass)
Leveling Roadmap
For level 1, take Barbarian for their Rage (emphasis mine),
On your turn, you can enter a rage as a bonus action. While raging, you gain the following benefits if you aren't wearing heavy armor: You have advantage on Strength checks and Strength saving throws.
This stacks with our lucky point per Advantage and Disadvantage on PHB page 173,
When you have advantage or disadvantage and something in the game, such as the halfling's Lucky trait, lets you reroll the d20, you can reroll only one of the dice. You choose which one.
Using Lucky + Advantage nets us an Athletics bonus of +7.5, assuming rerolling the lowest die in 2d20 only adds 2.5. Since our Strength mod is +2, and our proficiency bonus is +2, that means that our average grapple check is 1d20 +11.5.
For levels 2-5, take Bard, so that you are Barbarian 1/Bard 4 for Expertise at Bard 3,
Your proficiency bonus is doubled for any ability check you make that uses either of the chosen proficiencies.
Cutting Words at Bard 3 (College of Lore),
When a creature that you can see within 60 feet of you makes an attack roll, an ability check, or a damage roll, you can use your reaction to expend one of your uses of Bardic Inspiration, rolling a Bardic Inspiration die and subtracting the number rolled from the creature’s roll
And a +2 in Strength at Bard 4.
At this point, our proficiency bonus is +3, our Bardic Inspiration die is 1d6, our Strength is 17 which makes our modifier +3 and since we picked Athletics when we got Expertise, our total grapple check is now on average 1d20 + 16.5 vs 1d20 +[mod]-1d6.
For levels 6-8, take Barbarian, so that you are Barbarian 4/Bard 4 for the Feat Tavern Brawler,
Increase your Strength or Constitution score by 1, to a maximum of 20. ... When you hit a creature with an unarmed strike or an improvised weapon on your turn, you can use a bonus action to attempt to grapple the target.
Our grapple check is the same at this point, but now we can attempt to grapple as a bonus action if we don't attack with a weapon.
For levels 9-20, take Rogue, winding up at Barbarian 4/Bard 4/Rogue 12
At level 12, take the Feat Athlete,
Increase your Strength or Dexterity score by 1, to a maximum of 20.
Other optional feats to take at this level are: Heavily Armored, Lightly Armored, Moderaly Armored, Resiliant, and Weapon Master. They all provide +1 STR, but Athlete give you more perks. Athlete, Resiliant, and Weapon Master are better than the armor feats for that reason.
At this point, our Strength is 19, giving us a modifier of +4, and our proficiency bonus is +4. So our grapple check average is now 1d20 + 19.5 vs 1d20 +[mod]-1d6.
At level 19 we get Reliable Talent,
Whenever you make an ability check that lets you add your proficiency bonus, you can treat a d20 roll of 9 or lower as a 10.
at this point our proficiency bonus is 6. Our new grapple formula is (assuming you correctly choose to use the luck point on the lower die during advantage):
max(1d20, 1d20, 1d20, 10) + 16 vs 1d20 + [mod] - 1d6
At level 20, take one of the optional feats above to increase your Strength to 20. If you want to mitigate not taking the feat Grappler, then take Totem Spirit Wolf at level 7 (this gives your friends advantage on your grappled enemy, assuming they wouldn't already get this from flanking. Nothing to do about Restrained disadvantage to Dex save, though)
This makes our final grapple formula:
max(1d20, 1d20, 1d20, 10) + 19 vs 1d20 + [mod] - 1d6
That's a minimum 29 DC for your opponent, and a maximum of 39.
Grappling a Tarrasque
To get around a size restriction, we can have a couple of wizard buddies cast Enlarge on us, and Reduce on a Gargantuan enemy, and we are now able to grapple any creature. They also get disadvantage on their Strength checks, which works out best for us.
Due to the Tarrasque's Legendary Resistance, the wizards need to cast Reduce 4 times on it. It may be beneficial to wait until after Frightful Presence ends before attempting to grapple.
The Tarrasque's Strength modifier is +10, and its Dexterity modifier is +0, so it still makes sense for an Athletics check even though its at disadvantage. Our formula then becomes:
max(1d20, 1d20, 1d20, 10) + 16 vs min(1d20, 1d20) + 10 - 1d6
Minimum: 26 vs 5
Maximum: 36 vs 29
For a bit of analysis, if the Tarrasque rolls less than a 17 on either d20, or above a 4 on the d6, it's grappled. There are only 10 ways out of 400 for it to not roll less than a 17 (17+17, 17+18, 17+19, 17+20, 18+18, ..., 20+20), and only two-thirds of the 1d6 results allow it. Running the numbers, there is a 1.67% chance that we would not grapple a Tarrasque under these conditions.
However, on its turn a Tarrasque, assuming it hits us with every attack, deals 148 damage. Our max HP would be, assuming the fixed value for HP, 133, so our grappling madman would be a legend for 6 seconds.