IMO BMW specified 5W40 oil to cover the gamut of ambient temperature ranges the bike may operate in throughout the world. It rationalises the oils dealers have to keep.
The lower (thinner) the oils W rating the better for cold start up protection. But, 5W is rated to circa -30 C and 10W to -25 C so if you live where the min temps are above even 0 C degrees, a 10W oil will be more than 'thin' enough.
And, the smaller the viscosity range ie 10W40 as against 5w40, the more sheer resistant it is because less viscosity modifiers (which shear down) are required. True full synthetics are less prone to shear or do not shear because they have less viscosity modifiers or none at all.
I have tried many different oils in BMW bikes over the past 4 years and 95,000 kms changing at 5000-7000 kms and i keep coming back to an Australian produced (blended) oil from Penrite 10w40
MC-4ST 10W-40 (100% PAO & ESTER) | Penrite Oil
This is a true full synthetic POA/Ester oil which Penrite claim is 'shear free'. Penrite also do a 5w40 POA/Ester oil but this is shear resistant and i assume this is because they have to add viscosity modifiers to extended the viscosity range.
I have used Penrite 5w40 before in my 1200 & 1250GS. In the 1250GS after 7000 kms the gear change still felt good, an indication the oil had not sheared noticeably.
I last used Shell Advance Ultra 4T 10w40 (nearly the Shell oil BMW specify for the 1250) which was OK at 7000 kms but just replaced with Penrite 10w40 POA/Ester, the first i have used this particular Penrite oil in the 1250GS with 30,000 kms.
Mindful that new oil is always better ??, I can not believe how quiet & smooth the engine is running this Penrite oil. The typical internal knocking & clatter of the boxer engine is reduced by about 75% once moving and is barely audible (with ear plugs). So much so, it has made me rethink about moving from this agricultural boxer engine to a Honda Africa Twin.
Use a full synthetic oil.
10W40 should suffice for the majority of the world. And imo is better than a 5w40.
Change oil frequently, before the manufacturer's recommendation, especially if ridden in traffic a lot.
If you can obtain the Penrite 10w40 POA/Ester i suggest you give it a try. The guys i ride with who have tried the 10w40 POA/Ester (to shut me up recommending it to them probably) have stayed using it and are as impressed as i am with its performance and longevity, especially for the reasonable cost.
Ps i am not affiliated with Penrite in any way, other than paying for and using their oils in all my vehicles.