The entry level for a new-grad software engineer is 75-100+k in US. If you are working for 35-40k you are doing it wrong unless you chose to live in middle of nowhere where 40k is actually a nice salary.
At 75-100k you're not losing that much happiness and stress wise if you take a pay cut at a start-up.
If you have an offer of 40k at an established company and are taking a lower salary (30-35k) to work at a start-up, that will hurt significantly in terms of your happiness, stress, and your ability to pay your bills.