If you still go through with it, have an attorney create/review any agreement to prevent tax and legal problems for you, stock grants can be taxable immediately to you, and restricted stock will likely never be worth anything to you. The "best" way to do this is not to take ownership (unless you are going to be a founder or paid employee and you get grants), and instead to invoice the company and hold the debt contractually for invoiced services. You can finance your work for them this way but the moment you take stock things become a pain in the ass, and your chances of getting paid will be even less then doing invoice debt. Also, the stock they grant you will be so diluted and after preferences etc you'll never see a dime, unless you force non-diluting and take a preference yourself but then investors might be hard on the founder for raising money which again, means you won't get paid. Also, don't forget you will have to wait years for the stock to have a private or public market, or you will need provisions for the founders to be forced to buy you out at a minimum price by a specific date etc, it is a mess.
So again, the "best" way is to finance the work for them contractually and you still may want to file a UCC lien to indicate you hold a lien on their software asset until they pay. This way when investors or creditors go through due-diligence they will see the company owes you money for the product and so they will force the founder to pay you. To be fair, some investors get turned off by liens, but the reality is most IME don't care as long as the founder doesn't try to hide it and is up front.
I can share plenty of stories about doing these types of deals when I was younger and getting hosed by people who I felt would always be stand up.
The idea of a UCC lien is a very interesting idea, however, in this case, there is a very limited amount of work to do before a zero-stage investor is pitched. If that does not fly, I would of course lose all the non-cash compensation, and the limited amount of code existing would not be saleable or otherwise useful without a lot more work. No patents are involved yet, and even if they were, there would be the time and effort to go from a provisional to a full application involved.
If one were in a situation where compensation, over a longer time, is mostly in founder's shares and there is an asset sale at the end of an unsuccessful run, I can see such a lien being a really good idea.
To clarify and narrow my question: Is taking a SAFE fair? I'm pretty sure it can be fair to me. But is it fair to the founder? Fair to an investor who finds there is a founder-ish person in his same stock class?
Thanks for the very thoughtful response!
If you are an accredited investor and meet the guidelines according to the SEC then by all means a SAFE is totally fine although I'd still advise against it for what you are doing. But if you don't meet the requirements as an accredited investor executing a SAFE is dangerous for you and the founder as it may (likely will) turn off other investors who are even more risk adverse now than in the recent past.
Just my 2 cents, but unless what you are trying to secure is > $100-120k in fees you are going about it in a way which will raise lots of questions for the founder when they do go to raise and have little benefit for either of you. A founder owing some consulting debt at their seed round is not abnormal and is seen often, but a founder owing debt with stock guarantees/promises to a non-accredited investor is an issue that will come up during any due diligence.
I think you can definitely do a deal here if you really want, just need to explore other options which are less likely to raise questions and stick with common patterns because investors are worse then a deer in the woods. If they see anything out of the ordinary on a cap table or diligence sheet it can at worst spook them for good or at best just leave a sour taste in their mouth which means everything else is an uphill battle of proof for the founder.