If you want to perform as well as possible at the IM I think that is a very bad plan. 5 days won’t be enough to see any altitude benefit when racing at low elevation and you won’t taper well.
Also 5 days without swimming and cycling is not a good idea right before the race.
How do you plan to structure the 3-week taper, what is your current training load and what is your goal time? I have never done a long distance tri but short and mid distance to a relatively high level in the past (sub 2h olympic and 4:18 hilly 70.3). Personally, I would only really taper off the running for maybe 10-14 days and keep the cycling and swimming relatively normal right until the last 4-5 days. Since long distance is not really about speed you don’t need much sharpening. With a very long taper the risk of the body shutting too far down is quite high. If you are using trainingspeaks and have some experience with tapering using the PMC I thing that can be a good tool. For me I feel quite bad for 3-4 days when I start tapeing of a high training load and then need 2 days training (short with relatively high intensity) right before the race to get a good feeling back.