Doesn't LibreOffice Calc have a simple, standalone implementation of its formula functions, so that they can be copied instead of re-implemented by other projects?
That seems like an interesting avenue to peruse. I would imagine you would end up reimplementing a lot of what Calc has already solved. I'm thinking about mapping cells to cell references (A1:C57), how to handle VLOOKUP, sheets etc. If I had to do this, my approach would probably be to take the headless Calc code and strip out the parts that are unnecessary.