Hi. I want to provide an update on the project. I tried a drive impact screwdriver which didn't move the screws any bit. I was able to get out one of the screws using a screw extractor. However, it failed on other screws. I kept increasing the sizes of the drill bits and extract bits. But the screws wouldn't budge. I even used penetrating oil. I then used an oscillating tool to carve out a drive on each screw head and then tried to use a screwdriver/drill on it. This was able to turn one of the screws for a little while until the head broke off. The heads of other screws also broke off before I could turn them any bit. I think the screw extractor damaged them. If I used the oscillating tool at the beginning, maybe it would have worked.
I then realized that, even if I had managed to get out the screws, it won't have helped. After everything was done, I could see the metal ring is clipped into the plastic sleeve. So the idea of just replacing the metal ring was not going to work. I used the oscillating tool to make a circular cut inside the plastic sleeve and got the ring out. After that, I used a hammer and a chisel to knock off the rest of the sleeve that's glued to the PVC pipe. Now it is done!
By the way, I even got the test plug. But it doesn't fit. I think its diameter is not large enough for the pipe. Nevertheless, even though there were some tiny sparks when I used the oscillating tool to carve out the drives, I didn't feel there was any risk. I guess there isn't much gas as the smell is really very faint now, since the toilet has been taken out for over a month! (How stubborn those screws are!)
The next step is to glue a new flange to the pipe. Thank you all for the input!