For simplicity we assume that the earth is a perfect sphere with circumference 40000 km.
Imagine traveling at a constant speed s in the northwest direction. Then the rate at which our (great-circle) distance to the North Pole is decreasing is s/sqrt(2), no matter where we are along our path.
By assumption, the great-circle distance from the equator to the North Pole is 10000 km, so the duration of the trip is 10000 * sqrt(2) / s, and so the total length of the path is 10000 * sqrt(2) or about 14,142 km.
Note: One might quibble that one never actually reaches the North Pole by traveling northwest since the only direction into the North Pole is north, and so there is no answer to the question as posed. However, it is certainly true that if d(epsilon) denotes the distance (in km) that one must travel in order to get within epsilon of the North Pole, then d(epsilon) approaches 10000 * sqrt(2) as epsilon approaches zero. Therefore 10000 * sqrt(2) is the most reasonable answer.