Since 99+% of all startup ideas will fail, it makes no sense to invest and optimize upfront. If your startup runs into scalability problems, you can always fix those later. You should consider the first version a throwaway. More than likely, your investments will be wasted. Even if your startup succeeds, it will often be a pivot away from the original mission.
The only case where I would say this doesn't hold is your security/privacy architecture. You don't want to fix this later after you've let your customer's data be stolen, you want this done right up front. You can rewrite everything else about your product, except for the things, which if they go wrong, will result in people being hurt materially or physically.