I had wondered if it could be composted. One of my thoughts was that the office buildings in New York must throw out several tons every day.
It can help to loosen and aerate soil and is also a deterrent to digging animals such as cats.
I do know that coffee grounds have been used with great success in the compost heap and I’m sure if they were of a fine-enough grind they could be used much like pumice in soaps.
But then, I found this:
https://www.healthline.com/nutrition/uses-for-coffee-grounds#TOC_TITLE_HDR_18