For scenario #1, assuming you are not trying to save any beneficial bacteria, you should be able to run the filter on a bucket of permanganate solution. My guess is that you'll want to run it at 4 ppm for several hours. I would manually clean the filter first with plain water, so that the permanganate isn't battling layers of organic material. If the solution turns brown quickly, then you need to add more as it's all been used up.
If the second tank still has fish and you don't want to kill the filter bacteria, you can bypass the filter during potassium permanganate treatments, but you then have to do a series of treatments (three in total). I believe the recommended concentration is 2-4 ppm. Have hydrogen peroxide or a dechlorinator on hand and watch the fish for signs of distress during each treatment. Alternatively, if you feel that you can successfully re-seed the filter after treatment, you could just dose the entire system and recolonize with bacteria from another tank (or buy some, as there are some decent products on the shelf these days). Again, do as much tank maintenance as possible beforehand, or you're going to have to repeat treatments just to ensure that sterilization is successful.
There's some good information here, aimed toward koi in ponds, but which can be scaled down to the indoor aquarium with a little math:
KMnO4 is kind of an old school, shotgun approach, but I think it can certainly be used as long as you take appropriate precautions.
Another medication frequently used with goldfish is praziquantel, as their most common ailment seems to be flukes. This has the advantage of not toasting beneficial bacteria, not to mention being much gentler on the fish. On the flip side, it won't treat other problems.