My endgame accessory list consisted of: Fire Gauntlet, Mechanical Glove, Terraspark Boots, Celestial Shell, Brain of Confusion, Celestial Starboard, Berserker Glove (or Worm Scarf on Drunk Worlds). I'm assuming Master Mode by default since that's my go-to difficulty, so seven slots.
I'm also wearing Solar Armour at this point, partially invalidating many of the features of the Master Ninja Gear that otherwise differentiate it from the Brain of Confusion, namely the dash ability. Before acquiring it, I would be using the Master Ninja Gear instead of the Brain of Confusion. All accessories have a Warding modifier, but many of the accessories themselves are damage-focused to reach a sort of offensive/defensive "balance" that I think worked pretty well, as I've never had problems beating the game with this loadout.
Not saying this is the "best" melee build as that's up to the individual, but I've found it pretty effective, with minimal noticeable drawbacks (if any). I will say it's not the purest melee build, as I also carry around a Terraprisma and Stardust Dragon Staff, along with a Bewitching Table just to get more coverage, Flasks of Ichor, Sharpening Stations, Sentries (Frost Hydra, Rainbow Crystal etc.) and even Lobster Tails for a Well Fed buff during boss fights. So in that sense I go out of my way to ensure I have every advantage, but you could easily sacrifice most of these and the build would still get things done.