As a company, I typically find donating to a company/foss/whatever that "advertises" their donors is the best way to give them money, and it be an advertising expense.
That is small minded... It is best for all interests. I get a bonafide write-off, they get bonafide money.
I also pay developers for a commercial licenses for FOSS offerings, if they are able, that I never intend on using because the project looked promising.
I donate thousands of dollars a year between charities and open source software, Why wouldn't I do it in the most tax advantageous way?
I took it as "best" in "most likely to actually reach a person who can write a check" in the corporate bureaucracy.
In most of the companies I'm familiar with, it's very hard for engineers and their managers to spend money on things that don't have a tangible return, particularly something you can stick an inventory tag on.
Marketing departments, on the other hand, are purpose-built to spend money on intangible things.
I've coached a high-school robotics program that's mostly funded out of the company's marketing budget, which they justify because the students put logos on their machines. Everyone knows we're doing it because we think it's awesome, but we have to call it marketing to slip it past the beancounters.
I know you probably agree with me, but supporting an open source project your company's infrastructure depends on has a tangible return (better maintenance on the project). It's just that managers don't see it that way.
So, you want to get advertising with money that you write off for tax purposes. In many world states that would constitute tax fraud. And have the reputation of those FOSS developers benefit you, to boot. I'm sorry, that's a bit much from a small mind such as mine.
In the US, pretty much any expense that a business makes as part of running a business is deductible. You do not have to donate to a 501(c)(3) to get a tax break.