Dock at an Italian port, send a Telegram to BDU about your whereabouts and expect a fairly cross response, like being reassigned to patrolling on the Russian front without any cold-weather gear
WTF are you doing in the med with a IXB?!?

it's supposed to be used near Freetown and Newfoundland
My suggestion, grab some eels in Sardinia, stock up the boat with Pizza and Pasta and other Italian delicacies and get back through Gibraltar ASAP before the guards there get really nasty, if that doesn't work, keep resupplying in Italy until Salamis is available and then transfer to there
or use the Return to Base teleportation device your boat is equipped with and if you bring enough Italian goodies Donitz may not have you shot...
Or as an absolute last resort, or if you're tired of life, try to get through the suez canal and visit Japan