Probably the best and cheapest way is to go around asking other people at the Portal for a ride north on 395. Offer maybe 25-50 dollars for the trouble to take you. Once you make it to Mammoth, there's camping and lodging, and then you can take the YARTS bus over to Yosemite Valley. It comes once a day early in the morning. Check their schedule at yarts.com.
I picked up a flyer at the Bishop USFS ranger station a couple years ago, with a professional shuttle service that will take you anywhere. A lift from the Portal to Yosemite Valley might run $200, though, but you'd be back there quickly.
I used to hitchhike decades ago, and while this may be dangerous and unreliable now, it can be free. I'd offer maybe $100 for someone on this board to come forward, as there's a fair chance that some other hiker could use the money.
Another thought is to split the Muir Trail hike into two parts. Go from Happy Isles to Mammoth, then use YARTS to get back to your car in Yosemite. Then leave your car in Mammoth, hike to the Portal, then hire a taxi or find transport back to Mammoth. It's only about 100 miles one way, so that would go fast. You can use South Lake or whatever other east side entry instead of Mammoth, too.
Good luck, this is a common query on this board. Few do the Muir Trail at once, so there's little demand for this. If you live locally, ask a friend or neighbor. The Eastern Sierra is so beautiful, it'd be a pleasure for me, although I rarely make it all the way down to Whitney.