Williams battled back from a 3-0 deficit in the tie-break to take the first set.
The match between tennis' two comeback queens turned the instant Williams released a primal roar after blasting a backhand return victor after being broken in the opening game of the second set. And I don't want to get there. She has never been past the fourth round in a Grand Slam tournament, but is 22-10 so far in 2018 and one spot away from her career-high ranking of 10.
Serena Williams celebrates winning a point.
The pair exchanged breaks in the second set with Williams grabbing the decisive one in the seventh game before sealing a 7-6, 6-4 triumph.
Just as it looked like her campaign might end with a whimper, Williams upped both the ante and the volume.
Russian doubles star Alla Kudryavtseva said she hoped Williams's revolutionary black outfit leads to a rethink over the playing regulations.
Williams also won the Australian Open while pregnant previous year along with 22 other Grand Slams over her career.
Her phenomenal serve has not lost any of its sting and she sent nine aces flying past Barty.
Williams said. "This is me, and this is my weapon and machine".
However, her game failed to match her impressive outfit in the first set where she was broken in the sixth game by the Australian.
Williams hit 13 aces in the match.
Tuesday's match was the first at a major tournament for the 23-time Grand Slam champion in 16 months. "The connection that it gives me to Olympia, it's been one of the most magical things I've ever experienced".
A fifth ace of the contest won her the set.
Laughing as she made reference to the fictional nation in sub-Saharan Africa, which is home to superhero Black Panther from Marvel Comics, Williams told reporters: "I feel like a warrior in it, like a warrior princess, a queen from Wakanda maybe".
"I feel like everything else will fall into place".