Google Maps shows two routes, one around Slovakia and one through the center of Slovakia. About the same time either way. Which should I choose?
I like Slovakia, so I would go that way. Google says 1 minute longer. Along the way you can stop at banska bystrica and Banská Štiavnica 2 lovely town with great centers, lunch, shops. Then there is Spis and Orava Castles; two of Europe's great castles. And the drive through the Tatra Mountains is beautiful. Roads are narrow and winding. We have driven it in December with no problem. Spend a night in the region and see a lot more.
I suppose you mean by the car. Then forget that one around Slovakia. It's freeway to Breclav, then a little of so called fast road and then just normal road through the villages and towns, congested and very slow. I agree with James. Road through the center of Slovakia is much more scenic albeit not very fast either but lighter traffic than going through the Czech Republic. And I bet it is quite shorter, too.
Best way from Budapest to Krakow:
Budapest - Sahy - Zwolen - Banska Bystrica - Ruzemberok - Chyzne - Krakow
Drive will take around 6h