For a charity yes, but not for a non-profit (that is not a registered charity). The difference is that you can't get tax-deducted donations etc. if not a registered charity. But you can still apply for grants etc. that are open to non-profits only.
The advantage of a non-profit that is not a registered charity is that you can set it up just as quickly as a company: it is a company, with clauses you add to your own articles of association (of how that works in your jurisdiction) that state that profit will not be distributed.
One recommendable way that is applicable worldwide is to set up an Estonian Osaühing company using their "famous" e-residency scheme. The advantage is that, in Estonia, retained profits are not taxed. And for a non-profit, all profits are retained, as they cannot be distributed to shareholders! Friends of mine did this a year ago, and they documented the whole process here: