First of all the hadith you are referring to is clearly saying that there was a screen between her and her visitors (see here).
Putting a screen or asking somebody to hide ones nakedness (or body or 'awrah) is reported in several ahadith about the Prophet () or others taking a ghusl, so this isn't something strange at all!
Secondly how do you define a non-Mahram?
Her brother was one of the visitors, as you can clearly read in the hadith!
Aisha’s brother and I went to Aisha
An other narration in sahih Muslim says it was her foster brother (still a mahram).
So she was in a room with a mahram and a visitor which is absolutely appropriate and far away from being immoral! So far my own conclusions if we assume that the "supposed" non-Mahram has no opportunity to look at her 'awrah!
Did she take a bath in front of two men?
No as none of the two men saw her (neither before she was taking the bath nor later) as she was behind a screen, which is clearly mentioned in the hadith! All they witnessed were here explanations and the sound of her actions and those of the female whom served her by bringing water! This is what one could conclude from the hadith as stated, but what they have seen is unclear, maybe her head, but not much more of her!
Most narrations about sahaba or tabi'in visiting 'Aisha to ask her or get knowledge, show that she was very strict in not appearing in front of male visitors and beside that she asked her sister to breast feed some to create a mahram relationship (however "breast feeding an adult" is a discussed issue between sahaba) again the breast feeding was not like you may think they drunk the milk from a cup!
It is even narrated that once 'Omar was buried beside her husband () and father she began to wear her hijab when visiting their graves which were in her house (see for example Is it permissible for women to visit the graves of their loved ones?)!
Some backup from Hadith-Commentaries
Imam an-Nawawi in his commentary on the hadith from sahih Muslim quoted al-Qadi 'Iyad (my translation take it with care):
قال القاضي عياض - رحمه الله تعالى - : ظاهر الحديث أنهما رأيا عملها في رأسها وأعالي جسدها مما يحل لذي المحرم النظر إليه من ذات المحرم ، وكان أحدهما أخاها من الرضاعة كما ذكر ، قيل : اسمه عبد الله بن يزيد ، وكان أبو سلمة ابن أختها من الرضاعة ، أرضعته أم كلثوم بنت أبي بكر .
What is apparent from this hadith is: that they both saw what she has done on her head and upper parts of her body, which are parts a mahram is allowed to look at. And one of them was clearly her foster brother as it was stated, it was said his name was: Abdullah ibn Yazidm while abu Salamah was her sisters foster son as Um Kalthum (the daughter of Abu Bakr) has breast fed him.
قال القاضي : ولولا أنهما شاهدا ذلك ورأياه لم يكن لاستدعائها الماء وطهارتها بحضرتهما معنى ؛ إذ لو فعلت ذلك كله في ستر عنهما لكان عبثا ورجع الحال إلى وصفها له ، وإنما فعلت الستر ليستتر أسافل البدن ، وما لا يحل للمحرم نظره . والله أعلم
The Qadi added: If they didn't witness or see this then asking for water in their presence wouldn't make any sense, as if she did all of this hidden behind a screen that would make no sense and would only make sense if she was describing what she was doing, and she only placed a screen between her and them to hide what a Mahram is not allowed to see.
What a Mahram is allowed to see is defined in verse (24:31) as stated by Uma in his answer. And as the foster relationship is set equal to blood relationship both are mahrams and her brother and son of her sister!
In 'Omdat al-Qari , al-'Ayni added a statement to the last quote of al-Qadi 'Iyad (I'm not sure whether it is his own or a completion of 'Iyads statement) explaining some more:
وفي فعلها هذا دلالة على استحباب التعلم بالفعل فإنه أوقع في النفس من القول وأدل عليه ...
And in what she has done there's a link to the permission to learn by doing (practical exercise) because it has more effect than learning by (oral) instruction (or report or transmission).
This means 'Aisha asked for water to show them the quantity (one Sa'a صَاع) and then poured the water on her head to show them how to apply! Ibn Hajar al-'Asqalani in his fath al-Barry seem to attribute the statement to al-Qadi 'Iyad.
In his al-Mufhim lima ashkala min talkhis kitab Muslim المفهم لما أشكل من تلخيص كتاب مسلم abu al-'Abbas Ahmad ibn 'Omar al-Qurtobi أبو العباس أحمد بن عمر القرطبي held the opinion that abu Salamah ibn Abdurrahman is the son of the brother Aburahman of 'Aisha while his companion was her foster brother. However most hadith commentators say abu Salamah is abu Salamh ibn Abdurrhaman ibn 'Awf, which is the foster son of Umm Kalthoum bint abi Bakr the sister of 'Aisha!