This type of hing already exists in sylphon i think.
It uses a combination of a normal large slot, a hull mod, and a weapon.
The weapon has an OP cost of like 3000 and the hull mod reduces the OP cost of that type of weapon by 99%.
As such you can then use that slot like a normal large slot, which accepts medium, small, and large weapons, or you can fit the superheavy weapon. Which makes the slot perform exactly like a super heavy or “extra large” slot would.
If the ship did not have any other large slots that were not supposed to be XL you could simulate a universal/hybrid slot in a similar way by having the hull mod also increase the OP cost of large weapons by 100 times. (Thus the large universal would only be able to accept an XL turret)
But even then probably better to just build it into the ship