Welcome to the kingdom of the wise.
Namely, ST owners!
My ST1300 started doing this recently. It idles fine at start up, but then goes to 3000 to 4000 RPM for a few seconds- maybe 15, before settling down. Someone suggested a build-up of sticky fuel residue in the vacuum lines that the ECU derives its information from. To check would involve removing more bits that I want to just now (seat, tank cover, tank raised, air box top, funnels, airbox bottom (big pain to refit) then delve into the engine bits then do it all in reverse. So I'm living with it for the time being until I need to go there (e.g. to clean my K&N filter) or because I'm desperate for some flagellation.
Someone somewhere blamed Shell petrol for it. If you use Shell you might see a connection. I've been using it for years (it's handy and has discounts) and this has only started in the past couple of months.