No need to advise the airline beforehand. Whilst embarrassing I would be honest with the crew. I doubt if they would want 'proof*' of your condition, just that you will be in there longer than others. If possible, depending on aircraft, choose a loo that isn't isolated.
As S.o.S. said, choose a time when there is not a queue.
*Any proof that you could offer can be easily created on anyone's PC.