The only ethical way is just to ask. I'm not sure of any simple way of doing that where you wouldn't endanger any future positive reference - i.e., burning bridges. "Hey boss, I'm afraid I have to put in my 2 week notice. Real positive experience, thanks. Say, on an unrelated note - I would prefer to do almost anything other than being here for the next 2 weeks, so how about I just don't come in any more, and you don't have to pay me, and we still say I gave you 2 weeks notice. OK?"
The only polite, non-bridge-burning alternative is later (the next day or two later, perhaps), have a talk with your boss if you really have nothing they want you to do. If you've done all you can to be helpful for the next person, then you can politely note that if they don't have anything they want you to work on you would not be offended if they'd rather not pay you for another two weeks and just leave early instead. You could also facilitate this by asking to talk with your manager on what they need from you for the smoothest transition possible - turn over of equipment, reporting of any passwords they'll need to change, final report of any projects you were on, etc. By getting these done as early as possible (same day or next), then it could be taken better if you want to ask if they really need you for anything else - but still, I'd be careful here unless you are very socially gifted and skilled in handling such situations, as it's easier to make things weird and rude.
The truth is, I don't think any sane person alive really enjoys their last two weeks on a job, and no one really loves to work with a "short-timer" who will be gone in a few days. It's just an awkward reality, because anything else is even crappier and more rude (socially and financially). The notice period is there both for financial reasons to employees, as well as allowing a more smooth transition period for your employer and whoever will need to do your job after you are gone. It's a professional courtesy, and handling the awkward period with grace and patience will leave a good impression of you on your boss and co-workers. "Jeeze, that guy was even a good employee on his last two weeks - great fellow!"