If you're recoating the tank, pull off the petcock, and then screw in the two bolts that hold it on just enough to cover the threads, and so the bolt doesn't stick too far into the tank. If you're worried about messing them up, buy two replacements with the same thread and use those (I always use the original ones and haven't had any problems). Buy a rubber stopper that is the same size as the hole for the filler cap and use that to plug it when you are swishing the coating around (but make sure to take it out so the coating can dry). I can't remember if the hole for the petcock is round -- if so, buy a smaller rubber stopper for that. If not, you can use duct tape.
A couple other things: unless you are planning on a repaint, use painter's tape (blue tape) to cover some of the top of the tank in case of spills, and around the petcock. Whatever you do don't clog the breather hole in the top of the cap if you recoat -- if it's rusty, I usually just sand off the rust. Replacement rubber seals for the caps are cheap and plentiful, about $8 on Ebay or elsewhere.
Whatever you do, don't use Kreem. That stuff is the worst. I prefer POR-15 but have also used Redkote with good results. Most important thing is to follow the directions to the letter. POR-15 is a little more of a pain in the ass -- one extra step, and you've got to completely dry the tank -- absolutely bone dry -- before pouring in the sealer. This step was pretty easy for me when I lived in AZ, as you can imagine, but you can force air through the tank to make it dry, rotate it around, force more air in, etc. And let it cure for three days or so. I picked up a CB750 that the owner paid a shop $200 to Kreem, and either they or he put gas in it the next day, and it looked like someone poured oatmeal into the tank (and subsequently into the carbs). Got the bike for cheap and it was an easy clean, which was lucky for me.