It sounds to me like you suffer from anxiety or panic attacks.I have suffered from anxiety in the past too and I know the more you dwell on things the worse anxiety becomes.It wouldnt hurt to get checked out by your doctor and a cardiologist maybe. Donna
How hot is the water? If real hot, the sudden change to room temperature could well cause you heart rate to rise. The irregular beat is another mater, I believe, it seems to me that you must have that "weakness/problem" and it is dormant unless kicked off by some sudden physical change.
You also mention a HR of 40. This is very low, and for most of us it would cause us to be dizzy, even pass out. Some athletes have a healthy resting HR in the 50s, but 40 is too low, I believe.
Pain is another troubling sign, and it could be worth while talking to a cardiologist about getting a wearable heart monitor... these in my experience have to be removed when in the water, including shower...but could be put back on immediately after.
You physical description and age suggest that it is very unlikely that you have anything you can't beat, the problem is identification of the problem.