Everybody is different with this so there is no substitute for actually trying out the main scenarios and seeing which works best for you i.e. race after 2-3 days and race after 2 weeks or so and also a month. Have you ever raced at sea level before after training at altitude ?
Remember red blood cells have a life of about 120 days so to suggest that the altitude benefits start to disappear after a few days just isn't true.
My personal experience from many altitude trips is that racing after 2-3 days is not great for me. How much of that is down to fatigue from training/travel as opposed to the change in altitude I dont know and without doing a marathon taper at altitude I dont have a control to compare with ! That said the majority of european runners I discuss with have a similar experience when racing straight away.
I would suggest that the least risk option is to spend at least 10 days at sea level and preferably 2 weeks. The vast majority will race better in this time frame and you also have time to adjust to the relatively higher humidity for your marathon (I'm going down 16 days before my next marathon).
If you have no choice but to race after 2-3 days then the poster who suggested extra layers to get some heat acclimatisation is spot on. You can even wear a wet base layer to build some humidity :-)
Adrian