It's kind of difficult to keep throwing out ideas for you without much participation from you. Are you truly interested in a 40-mile DAY hike? Are you an ultrarunner or marathon hiker or what? How many passes might you be able to do in this "day" hike? Mt Whitney is 22 miles -- how long did that take you?

What means would you have to arrange transportation? Do you have two cars and a friend to drive one to the exit point, or someone who will drive to the opposite side while you hike the route?

Those sorts of things are a bigger deal in planning such a hike than actually hiking the route.

My favorite online map site for planning is gmap4 (mappingsupport.com). Here's a link to the gmap4 map with the cross hairs on the Onion Valley trail head. If you want 40 miles, hike over Kearsarge Pass, take the JMT north over Glenn Pass, and descend to Roads End via Rae Lakes and Woods Creek/Paradise Valley. That route is part of a 40-mile ultra-runner loop out of Roads End. (Roads End in Kings Canyon is named "Kanawyers" on the map.)