It still took him four match points over three games to get the job done against a player he beat in three sets in the first round of the Shanghai Masters this month.
“It was a very good win for me, I’d rate it at eight out of 10,” Federer said. “He played me tough in Shanghai.
“I was feeling good on court apart from closing it out, I had a few errors there.
“He finished late last night and maybe his legs were a bit heavy. I was able to use my experience today.”
Medvedev saved match points in the seventh, ninth and 10th games of the second set before Federer advanced from the Russian’s concluding error.
Federer will bid for a ninth title at his hometown event on Sunday as he takes on Marius Copil.
The 93rd-ranked Romanian became the first qualifier to reach the Basel final in more than a decade as he upset Alexander Zverev 6-3, 6-7 (6/8), 6-4.
“I still can’t believe I won, it’s been an unbelievable week for me,” Copil said. “When I came here I was fighting to stay in the top 100.
“I was just hoping to win a few matches. Now I’m in the final, it’s an unreal achievement for me. I cannot wait to play tomorrow.”
‘Still can’t believe this’
Federer, 37, spent almost 90 minutes less on court Saturday than Copil, who has had to come through six matches to reach his second career ATP final.
“I hope Marius spent a lot of energy in his match, I’m feeling very fresh,” said Federer.
“It would be great to win my 99th career title here in Basel.”
It took top seed Federer just 19 minutes to secure the opening set against Medvedev. He kept his foot on the pedal in the second, racing to a comfortable 4-0 lead but had to fight to emerge the winner.
The world number three will aim for his fourth title of 2018.
Copil will be competing in the biggest match of his career after overcoming second seed Zverev, with the Romanian having dropped just one set this week.
The 28-year-old outsider fired 26 aces, with his impenetrable service game laying the basis for a surprise win.
He needed 44 minutes to claim the opening set but was brought back to level-pegging as Zverev won the second in a tiebreaker.
In the third, Copil kept pace, with Zverev faltering on serve in the 10th game and his opponent taking advantage with a cross-court volley winner to advance amid cheers for the underdog.
“I knew this would be a tough match,” Copil said. “I was hoping to serve well, get some free points.
“I tried to mix up my game, not giving him any pace. He never misses on a backhand but I hoped to play well against his forehand.
“I think I had very good tactics against him – but I still can’t believe this.”
The Romanian, who will face Federer for the first time, had already upset 2016 champion and third seed Marin Cilic in the second round.