The reason for their route to the Mountain is given in the book, in the chapter Queer Lodgings, while discussing the route through Mirkwood:
"Do we really have to go through?" groaned the hobbit.
"Yes, you do!" said the wizard, "if you want to get to the other side. You must either go through or give up your quest. And I am not going to allow you to back out now, Mr. Baggins. I am ashamed of you for thinking of it. You have got to look after all these dwarves for me," he laughed. "No! no!" said Bilbo. "I didn't mean that. I meant, is there no way round?"
"There is, if you care to go two hundred miles or so out of your way north, and twice that south. But you wouldn't get a safe path even then. There are no safe paths in this part of the world. Remember you are over the Edge of the Wild now, and in for all sorts of fun wherever you go. Before you could get round Mirkwood in the North you would be right among the slopes of the Grey Mountains, and they are simply stiff with goblins, hobgoblins, and orcs of the worst description. Before you could get round it in the South, you would get into the land of the Necromancer; and even you, Bilbo, won't need me to tell you tales of that black sorcerer. I don't advise you to go anywhere near the places overlooked by his dark tower! Stick to the forest-track, keep your spirits up, hope for the best, and with a tremendous slice of luck you may come out one day and see the Long Marshes lying below you, and beyond them, high in the East, the Lonely Mountain where dear old Smaug lives, though I hope he is not expecting you."
Nothing dumb about that way; it was deliberately chosen to avoid even worse trouble.
As for the way back, not only had the Dragon been defeated, but so had the Orc army, and the Necromancer had also been driven from his lair. That's got to count for something in terms of making the journey easier. Moreover, Bilbo had company - powerful company. Despite that he did have further adventures (and trouble) on the way back, which are simply unrecorded:
He had many hardships and adventures before he got back. The Wild was still the Wild, and there were many other things in it in those days besides goblins; but he was well guided and well guarded - the wizard was with him, and Beorn for much of the way - and he was never in great danger again.
(The Return Journey)