This reminds me of some of Terry Pratchett's books, especially the Rincewind series. While our hero here is better at magic than Rincewind, it's not by much, and the jokes come fast and furious. The finale is a bit open-ended and begs for a sequel.
Very neat book. Would read again!