I think there's a further bit of explanation missing: the person who designed it didn't know what they were doing.
Personally, I think it would have made much more sense to replace a&b
and leave a&&b
as is - i.e. remove the underline but otherwise leave the final display text as is. With the current behaviour, I suppose a menu item a && b
which displays as "a & b" would display as "a b" in a tooltip, which would obviously be incorrect.
Stripping the first & regardless of what follows it would make sense if the tooltip used TTS_NOPREFIX, since that would convert a&&b
, which would then display correctly. But the system doesn't strip any ampersands if you use TTS_NOPREFIX...