Paid temporary job as research assistant
He will almost certainly agree to use your talents for the remaining time, and pay you the full sum. Take some additional time to check your work; speed and quality will matter. Then talk to him about your predicament, and request to be kept on for the agreed upon hours doing whatever it is you agree upon. He should be impressed that you do good work quickly. Do more, you may acquire an ongoing arrangement.

Note that this outcome is not guaranteed: humans can be strange creatures sometimes. That said, it is virtually guaranteed. If you have a good relationship, I suspect you can proceed without fear.