I don't know much about pacemakers, but I thought that a lot of them now had an inductive loop so you could charge the battery through the skin.
When I was young I saw, in a museum, a nuclear-powered pacemaker. I guess they were used before battery technology improved. The power source lasted quite a while. I'm not sure how it worked, exactly. I think nuclear batteries normally generate heat and use thermocouples to create electricity, but I don't know if that's how these worked.
Just to address a minor point, open heart surgery is not required to implant a pacemaker or defibrillator. The device itself is placed under the skin via a small incision, and the leads are passed through veins into the heart via catheters. Pacemakers implants are sometimes performed on an outpatient basis, and defibrillators typically involve just an overnight stay.
Replay available now: A handful of emerging network technologies are competing to be the preferred wide-area connection for the Internet of Things. All claim lower costs and power use than cellular but none have wide deployment yet. Listen in as proponents of leading contenders make their case to be the metro or national IoT network of the future. Rick Merritt, EE Times Silicon Valley Bureau Chief, moderators this discussion. Join in and ask his guests questions.