There are of course many illness that can occur without much warning.
Calling 999 is the only course of action other than perhaps a friend to come and help too (take your vehicle and you back home). All hospitals will of course take you in and treat you and once diagnosed decide your length of stay. All proper precautions will be taken too to keep you isolated.
The problem is that when you fall ill, you might not know what it is and so others become infected before anyone realises.
I totally understand the difficulties and the embarrassment such problems can involve however, and hence why calling the police/ambulance is necessary. Not sure if the AA would help you take your car home though if it is you that has malfunctioned !
I tend to have a host of 'kit' that might get me out of bother, but a very urgent need for a toilet when ill is a most difficult one to solve.
I think that unless you were in a traffic jam you would be able to reach the hard shoulder. But when is is best to turn on the hazards? You need to indicate to reach the HS but you also need to express your urgent need. It is a little bit of a conflict. I think I'd indicate and get to the HS as quickly and safely as I could, then apply hazards. By always trying to ensure that I have good space around me, it will also allow for this circumstance and my ability to start to show interest in puling over.