I use Lua for this sort of thing. Not my favorite language, but it works well for it. Easy to build for any system in the last 20-30 years, and probably the next 20 too. The executable is small so you can just redistribute it or stick it in version control.
Anecdotally Windows is the only platform I’ve used where printing (and scanning) didn’t tend to “just work”. The only issue I’ve had printing under Linux was with a second hand printer my dad got that we couldn’t get to print from any computer. (shrug)