The bend in an aluminium mast is no problem (as long as there isn’t a “crimp” in it) just release the diamonds and support the head and base of the mast on anything off the ground (two timber work horses are good or two chairs but not on any sharp edges, even to the point of putting a pillow under the top and bottom of the mast) then looking along the mast with the bend upwards sit on the maximum point of the bend rock up and down exerting enough pressure to gradually take the bend out. Always check by looking along the length of the mast every couple of “bounces” to check your progress. Don’t be surprised at how much “weight” you have to put on the mast to get it to respond. When the mast is straight then continue to “bend it in the other direction to duplicate the approx’ bend in the opposite direction. After which reverse the mast and in the same way take that bend out of the mast.
The reason that you put a reverse bend into the mast then remove it is because when the original bend occurred one side of the mast section has been slightly “stretched” and if you simply remove it there is still a bias in the wall from one side to the other. By duplicating the original bend the other way, then removing it you have evened up both walls and the bend won’t show up as a different bend characteristic from tack to tack when your sailing as it would if you only removed the original bend.
The twist is another thing entirely. Firstly check when the diamonds are disconnected completely to see if it is only due to the position of the bend and the diamond tension that the mast only appears to have a twist and then check after the bend is removed, the “twist” may disappear with the bend. Other than that I have removed dozens of bends in Aluminium masts but I have never seen one twisted except straight from out of the dies during manufacture.