The fourth-seeded Swiss player never lost his serve against the 29th-seeded del Potro, who had five break-point opportunities but could not convert any of them.
The win improves Federer's match record in 2017 to 15-1, and he has won 14 consecutive sets.
"Just shortly before I walked out to the court, you could sense the atmosphere," Federer said. "That's when I told myself, just be prepared for something different. And it was different. I think if the match had gone three sets or to tiebreaks or something even closer, it would have been really epic.
"It was just really a nice atmosphere, nice weather, great opponent, great crowd, what else do you need? Just another good press conference with you guys and it's perfect."
Federer, 35, got the service break he needed in the eighth game of the first set. While serving for the set at 5-3, Federer fought off four break points against him before closing out the set.
Federer got the only service break of the second set in the fifth game, and he served out the final game at love.
"I did my best," del Potro said. "He played well in the break-point moments, and I think that was the only difference in the match."
"I respect Bautista Agut a lot," Federer said. "I was watching his match against Querrey a lot today, and he competes so well, plays a ton of tournaments and he's really just match-tough.
"He might be hurt, he was taping his feet, I don't know what he was doing, but I'm sure he was in pain. But he found a way to get it done in the end. I have a really good record against Roberto, and I hope I can use my variation to make him feel uncomfortable.
"I look forward to backing up tomorrow now. It's not something I am used to, actually playing back-to-back days, so I hope my body's going to be fine tomorrow. But that's why it was key also today not to waste energy."
In another third-round match, top-seeded Stan Wawrinka of Switzerland got past Tunisia's Malek Jaziri by the same score as the Federer match, 6-3, 6-4. Like Federer, Wawrinka never dropped his serve, saving six break points.
Eighth-seeded David Goffin of Belgium rallied for a 4-6, 6-3, 7-5 win over Diego Schwartzman of Argentina.
Also in the third round, 18th-seeded John Isner of the United States let three match-point chances get away in a 6-7 (5), 7-6 (7), 7-6 (5) loss to 16th-seeded Alexander Zverev of Germany. Each player had his serve broken once in the first set, but those were the only two breaks in the match.
Isner had his first match point while receiving serve at 6-5 in the second-set tiebreaker. Isner then had a double match point with Zverev serving at 4-5, 15-40 in the third set. But again he failed to convert, eventually losing in the tiebreaker.
Also, 10th-seeded Tomas Berdych of the Czech Republic eliminated Gilles Muller of Luxembourg 6-3, 6-4. Berdyck's next opponent is Adrian Mannarino of France, who needed two hours and 38 minutes to get past 20-year-old Borna Coric of Croatia 6-4, 2-6, 7-6 (3).
Mannarino let a match point slip away in the ninth game of the third set before winning it in the tiebreaker.
Nick Kyrgios of Australia, who is seeded 12th, got past 17th-seeded Ivo Karlovic of Croatia 6-4, 6-7 (4), 7-6 (2).
It has been an up-and-down season for Kyrgios, who lost in the second round of the Australian Open and has had some questionable on-court behavior.
"I was in a really dark place after the Australian Open," he said. "I'm stronger mentally and really trying to fight for every point."