For there to be electrolysis, there must be a potential difference and a salty (conductive) liquid between the parts. This is not the case with a screw in a motor.
If it can reassure you, early 1970s the LAVERDA SF 750 and 1000 were fitted as standard with A2 stainless steel screws, so almost 1/2 a century, and we have never heard of corrosion.
The new TRIUMPHs are fitted with A2 stainless steel screws. Are TRIUMPH engineers incompetent?
The only precaution, if you have any doubt, is to mount the screws with copper grease.
Personally, I've had trial bikes with dry-fitted stainless steel screws for over 15 years that run in water all year round without any corrosion.
The same can't be said for magnesium parts that wear out in a few years.