So, you are tendering at St M and want to go quickly to Portofino after arriving back to St M around 3:30 and must be on ship at St M by 6, which might mean last tender at 5:30? If so, the only possible way is to hire a taxi to take you and return. It's a lovely (twisty) drive along the coast and not too far via taxi. It could be done in an hour. I know everyone has heard of Portofino. But, consider just enjoying the area near St M, also beautiful. Or go to Hotel Continental on the outskirts of St M and have a drink on the terrace for the amazing view. We actually walked (and a bit of bus) from our cruise stop at Portofino to St M and spent the day there.
Why taxi: There are public buses, but they will likely be full at that time of day going back to Portofino, esp. if a ship in in port there. We took the bus and it was standing room only and sometimes the buses pass by if full. Even if you got a bus, it would be too iffy for the return. There is also a ferry, but I would not try it for under 2 hours.