I have seen so many opinions on this that I can only offer what I have learned by really thinking about the problem from a chemist's perspective..
For the best way to clean your tank,you really should know what kind of dirt is inside it. I have cleaned one automobile tank,one farm tractor tank, Two motorcycle tanks,and I have a PERFECT 35 year old tank from a CB500. It is really important what condition the tank is in before you start.
If your bike is a beater bike,with a rusty tank and you really do not care if it holes through after you clean it,by all means use whatever harsh chemical will do the job and the faster the better! If you want to use the most gentle method,I will describe it as going with electrolysis. If you have a nearly perfect tank with little rust and very nice paint,even electrolysis can ruin your efforts.
There are two kinds of problems. one is rust,and one is varnish. I usually go after the varnish first because varnish will coat the tank and the rust in the tank,making the rust more resistant to being removed by any method, electrolysis included
The cheapest way to remove varnish is with lacquer thinner. It simply dissolves the stuff into itself [dissolves into solution], and what does not completely dissolve turns into soft jelly. I get mine at a Sherwinn- Williams paint store for 15-20 bucks a gallon. Let the stuff set for several days,and it will not hurt the tank at all. Nice if you can afford enough to completely fill that tank.
Make sure that you save what comes out of the tank, because you can use it over again. I let all the gunk and rust settle and just draw off the clear [amber by now] liquid that comes to the top.
Electrolysis with laundry soda [not baking soda] as the electrolyte worked really well for me. It worked very well because I was working only on the rust and not a bunch of gasoline leftovers. Keep in mind to use a manual battery charger and a steel rebar works well to attract the rust,but when the reaction stops,you must clean the bar and just keep using the solution in the tank. Even when I covered the outside of the tank with heavy grease,the trail of foamy bubbles that came out of the tank washed the grease off and left a whitish stain behind, and that is what to watch out for. 5 thousand miles and three years later,no rust has returned. Note that I did use oxalic acid to convert the bare metal to a blue/black coating.
Now about my pride and joy Cb550 tank that has darn near perfect factory original paint. I will use lacquer thinner first to clean what little gunk was left behind with gas and Stabil in the tank, in there 21 years, and perhaps a mild solution of toilet bowl cleaner [about one-10 ratio] to loosen the rust if any is present.No foam,no drama, filled to the top---just get it clean as possible without risking the paint. Many rinsings,dry it with shop vac exhaust, and then a treatment of oxalic acid that will convert what rust remains to an inert coating. Dry it again with the shop vac
There are postings, YouTube videos,and gobs of stuff about electrolosis that are available by searching the net. No need to repeat it here.