To Fix Or Not To Fix, That Is Often The Question.
After successfully extracting the three badly leaking batteries from the D-cell Maglite we have, I can say with authority that every YouTube video and web forum advice article I found concerning how to do this is pretty much limited to a situation in which the batteries have leaked relatively little. Mine had leaked *lots*. I ended up making a tool for the most critical part of what had to be done.
First, let me comment on the various suggestions I found which did not work:
--Use acid (phosphoric, acetic and citric all are suggested in one place or another) to eat the leakage, ostensibly freeing up the stuck batteries. It doesn't work if there's more than a tiny amount of leakage and/or the leakage has been present for some time. (The potassium hydroxide inside the battery will aggressively attack aluminum, forming salts that are not readily dissolved by acids unless the acids are strong enough that they will also damage the aluminum further. Anything that will eat the hardened crud that's holding the batteries in place probably will also eat the flashlight.) (Note: Phosphoric acid is the ingredient in colas that allows them to be somewhat useful in removing very minor corrosion. Neither cola nor any of the various commercial phosphoric-acid-based corrosion-removal products like C-L-R are effective in attacking bad buildups inside of a Maglite when the batteries have leaked significantly. Citric acid is the active agent in lemon juice; same problem. Acetic acid is what's in vinegar, ditto. Don't even think about using stronger stuff like the jug of high-strength muriatic acid that you bought back when you had that house with a pool in the back.)
--Heat the barrel of the flashlight with a heat gun or by dipping the flashlight in hot water briefly to expand the barrel away from the batteries, and then either knock the open end on a block of wood or use a screw and a pulling device to extract the battery. This simply doesn't work if the corrosion has been present for too long.
--Use a "dent puller" (slide hammer with a large sheet metal screw on the end) to extract the batteries; as above, doesn't work if the leakage has been present for too long.
--Use a long, large screw to act as a puller directly; see notes about dent puller, same problem.
What *did* work:
One battery at a time, I punched a hole in the center of the back end of the battery, and used a hole saw slightly smaller than the diameter of the battery to clear the metal end out of the bottom of the battery. Using a long punch, I upset the plastic washer just inside the end of the battery, grabbed the washer with a long needlenose plier and pulled it out. I then used a pressure washer to flush out most of the guts of the battery. This left lots of stuff still inside the battery casing, so I used a very small dead-blow hammer to whack the side of the flashlight barrel and break up the sleeve of black stuff lining the outer shell of the battery, and then flushed again with the pressure washer. On two of the three batteries, the shell of black stuff didn't easily break up, so I went back in with the hole saw, with the pilot bit drawn all the way up inside the saw shell, and demolished the black material to allow it to be broken up and flushed out. With the battery's shell empty, I needed a way to get it loose from the inside of the flashlight barrel, and that's where I concluded that I needed to make a tool. I ground a shallow angle on the end of a long "alignment punch" to make a peeling chisel that could be driven in between the battery shell and the flashlight barrel's inside surface, deforming the battery shell toward the inside of the flashlight barrel and breaking it loose from the barrel. I then grabbed the deformed shell with extra-long-reach needlenose pliers and pulled it out. I used the peeling chisel again to tap on the remaining metal disc that was glued to the battery ahead of the one just removed, and extracted it with the extra-long needle nose pliers when it came loose. The peeling chisel was deployed once more to break the leakage cruft away around the edge of the next battery. From there, it was a matter of repeating the steps above until all batteries were out. There was still an irregular layer of cruft on the inside of the barrel, composed of the hard and insoluble compound that results from the reaction of potassium hydroxide with aluminum. Scraping it out with the peeling chisel was only partially successful, and I ended up scouring out the last of it with a brake caliper hone, which is an automotive specialty tool that you probably won't have.
Be aware that the guts of the battery can contain irritating or hazardous chemistry. (In particular, potassium hydroxide, which is truly nasty stuff.) Wear safety goggles and appropriate gloves and gear to avoid skin contact. Most of the time, batteries that have leaked will have already reacted the caustic substances out to where they're pretty much inert, but it's not a good idea to assume that this will be the case. Keep the dog, the cat, the kids, and that idiot from down the street who thinks he knows everything well away from where you're working until you can get it properly cleaned up and the debris bagged and into the trash barrel.
Important note: You have to be really careful with the drill that's driving the hole saw, or you can tear up the threads for the end cap inside the barrel. And when using the hole saw on the third battery, you'll need to get clever with inventive solutions and/or use a special extra-long arbor in order to get the hole saw to reach that depth inside the barrel.
Another important note: NEVER bang on either end of the barrel with a hammer, or bang it on a hard surface; the aluminum tube is soft, and will mushroom, ruining it. You can do a *limited* amount of whacking with a *small dead blow plastic mallet*, and a *limited* amount of banging the battery-cap end of the tube on the floor or a hard surface WITH THE BATTERY CAP INSTALLED, but even this needs to be done cautiously.
If you had a good vertical mill or drill press, and an appropriate vise and bit, it would be possible to core all three batteries in one step, and then peel them out with the peeling chisel. If you had that kind of tooling, this option would probably be obvious, and you'd likely know exactly how to go about it.
Once the leaking batteries are removed, it becomes possible to access the switch assembly, which *may* respond to attempts to clean it out, but most likely will have to be replaced instead. I was able to source it on Amazon.
That's the whole of it. If, at this point, you're looking at the level of complexity involved and saying "that's way too much work, I'll just buy a new flashlight instead", I can't say that I blame you. It really was way too much work, and had this not been a special edition Maglite that I'd be unable to replace, I would have given up and chucked it myself - and most likely bought something cheaper that produced more light. It's your call, but at least now you know what you're up against.