To start, I would say never get a Mac that you cannot afford.
That said, I have noticed that many people on the forum tend to think that most BTO upgrades are a waste of money, and I strongly disagree, with the exception for RAM on the 27" iMac, as you can easily do that yourself.
An exception to not getting a BTO of RAM is when it might benefit you to get the upgrade due to not replacing the existing RAM sticks that comes with the Mac. Example for if you wanted 32GB of RAM, iMacs come with two 4GB sticks (8GB) and you do a BTO option for two 8GB sticks (16GB) and buy two more 8GB sticks to install yourself. This might be cheaper than getting the base RAM just to replace them with four 8GB sticks. Then you will have two 4GB sticks that you are not using, going to waste.
Would a base 27" model with 256GB SSD upgrade last for 4-5 years?
This depends totally on what you plan on doing with your Mac 4-5 years from now, but I can tell you about my latest new Mac.
I got a Late 2012 iMac when they launched, and got BTO options for the much faster i7, 680MX GPU, and 1TB Fusion (which is much better than the current 1TB Fusion Drive). I upgraded the RAM myself, and am now using a NVMe with a TB3 enclosure as my boot drive.
My iMac is 8 years old, and it still runs like a beast. Originally, I planned on keeping it for three years, and getting the next iMac that came out (2015 iMac), but it was still really fast. Same happened with the 2017 iMac, and now the 2019 iMac.
I figured I would have replaced my iMac by now, but it still is really fast for what I do. I am sure if I didn't pay a little more in the beginning on the BTO options, I would have replaced the Late 2012 long ago.
and not including the cost for an 256GB SSD upgrade option (must include)
While Apple's internal SSDs are really, fast, you can get some really fast external drives to boot from for a fraction of the price of Apple's SSDs.
Would it benefit paying for a higher configuration model? Lets say from now to like 4-5 years
Typically, the higher spec processors and GPUs would still perform well after 4-5 years when compared to the base model specs.
There could be benefits if you ever decide to sell your BTO Mac.
Like I said earlier that many people say that BTO options are a waste of money when you sell them, but another thing to keep in mind is that the Mac without the higher end BTO options end up being a (figurative) dime a dozen. It is the higher spec Macs that are more rare and tend to hold value better, especially after the initial depreciation period.