Buying a bike for a 3 week trip would be too time consuming - unless you are prepared to write the cost off at the end of the trip or had someone to sell it for you. A foreigner cannot own a motorbike under his own name now, so you would have to get it registered under someone elses (or the dealers) name. Renting is the best way to go.
There are 2 main agencies that do one-way rentals to individuals, Green Discovery and Jules Classic Rentals. Jules' office is in Vientiane only, but Green Discovery have offices in Luang Namtha, LP, Thakhek and Pakse also. Both have websites so contact them and ask about your trip. As a minimum you should be able to pick up from Green Discovery in Luang Namtha and drop off in Pakse.
Costs for bikes these days are about $8-10 for a real Honda/Yamaha 110cc semi automatic, or from $25 for a 250cc trials bike (Baja). Jules has other models of bigger bikes up to $50 or so. There is also a charge for one-way, $50 I think. Check the websites.
http://www.greendiscoverylaos.com/
http://www.bike-rental-laos.com/
The roads in the north change annually as they are never professionally maintained, but are generally absolutely fine for motorbike travel. The route you propose is all on National Roads so they get maintained. You might want to look at a map and take some detours off this main road.
From Houayxai - Namtha the road is perfect, Namtha - Oudomxai -LP patchy, and LP- Vang vieng-Vientiane fine for the most part.
The speed limit is set by the bends in the roads more than the occasional sign, but you do get some idiots in their Prados doing 120kmh along the straights on the last 80km to Vientiane. Also watch out for people coming round blind bends on the wrong side of the road, or overtaking against head-on traffic.
Edited by: nabanga