Probably would have to be a foiling tack. If the board touches down while pointing more or less upwind, the speed loss would be too high for the sailing angle.
Freestylers have foiled through 360s, so having the board go through an upwind turn while on the foil is possible. However, the 360 does not require any foot movement or sail flip, both things that tend to kill speed. I think Balz has gone switch and ducked the sail on the foil, so he probably could do a foiling duck tack. Not likely to see that in a race, though - switch ducking a large cambered race sail is a different story!