If you started as an entry level or new grad developer, than 1-3 months is pretty common, and fair. If you were mid-level 3-5 years experience, than 1-4 months is not unreasonable depending on the reason for split. But remember, if they are terminating you for a specific cause they may give you zero to 2 weeks.
If you are senior or held one or more critical rolls during your time, than it is not unlikely they ask for some additional non-compete time or non-disclosure time, especially if you were privy to current R&D or other key company details. For that, they need to pay, and it should be reasonable to the time period they are requesting. That doesn't mean they'll pay you for 2 years, but I would be more likely to ask a professional compensation consultant or employment attorney for advice in this case if I wasn't sure. Remember, if you are being let go, the company's attorney or a fairly senior level HR person has been consulted so no harm in you getting advice too.
While generally not an issue in the engineering space, acceptance of a severance package in the U.S. (IANAL so double check your specific state) will prevent you from attaining unemployment benefits from the state. Again, fairly uncommon in engineering type roles as people are really mobile. However, I have had to let go of some people outside of engineering roles that took a severance and then filed for unemployment months later. They were quite upset when we challenged it and they were denied unemployment benefits. One of the primary reasons you are getting severance is to prevent the company's unemployment costs from rising.