FWIW, I went for a heart checkup at the hospital recently. They were doing ECGs as normal, but they weren't doing ECGs-while-exercising due to covid risk. I think the difference between regular breathing and hard breathing due to intense exercise may be significant.
My personal take on gyms would be that well ventilated ones are likely quite safe, but the most are probably not sufficiently well ventilated.