R. Yechiel Yaakov Weinberg has a responsum that deals with this question. It is a lengthy responsum (and you should read it in it's entirety if you can) but one key point is what he derives from Rambam's wording of this rule:
Shu"t Seridei Eish 2:90 (Mosad Harav Kook edition)
יוצא מדבריו שהאיסור הוא רק בעושה לשם מצוה ומתכוון לחדש דת אבל לא
בלומד מאהבת חכמה או להכיר תורתם של ישראל וכמו בשבת שאם ישב בטל אינו
עובר אלא רק בקבע יום לשביתה כמו שכתב שם אם עשאהו לעצמו כמו שבת
(ועיין ברדב"ז שם שכתב כן) כן הדבר בתורה שהאיסור הוא רק אם קבע את
הלימוד לשם מצוה והרי הוסיף בזה על שבע מצותיו וחידש את דתם שלא כפי
המצווה עליו
It comes out from his words that the prohibition is only when [the
non-Jew] does it for the sake of the mitzvah and intends to
originate religion, but not if he learns out of love of wisdom or to
recognize the Torah of Israel. And just like with Shabbat where if
[the non-Jew] sat doing nothing he does not violate [the prohibition
of a non-Jew observing Shabbat] unless he designates the day for
resting, as he writes there "if he made it for himself as Shabbat"
(and see Radvaz there who writes this), so too it is with Torah – the
prohibition is only if he designates the learning for the sake of the
mitzvah, by which he is adding to the seven mitzvot and originating religion not in accordance with what was commanded to him.
He reiterates this later as well:
מכל מקום האיסור הוא רק אם הוא קובע הלימוד בתור מצוה ונוהג בעצמו מנהג
ישראל וכן בשבת אם קובע יום מיוחד לשביתה כנ"ל משא"כ אם הוא יושב בטל
מתוך עצלות או לומד תורה מתוך אהבת חכמה כמו שלומדים שאר חכמות או מתוך
רצון גרידא להכיר תורתן של ישראל אז אין שום איסור לא על העכו"ם ולא על
ישראל המלמדו
Nevertheless, the prohibition is only if [the non-Jew] designates the
learning as a manifestation of a mitzvah, and acts with himself
[according to] the custom of Israel. And so too with Shabbat, if he
designates a specific day for resting, as mentioned earlier. As
opposed to if he just sits doing nothing out of laziness, or he learns
Torah out of love of wisdom like learning other branches of wisdom or
out of simple desire to recognize the Torah of Israel, the there is no
prohibition – not on the non-Jew, nor on the Jew who teaches him.
He also adds that even in a situation where it is forbidden for the non-Jew to learn, it is probably not forbidden for the Jew to teach him:
ולפי דעתי אין איסור על המלמד אפילו במקום שמתכוון העכו"ם לשם מצוה שאין
זה דומה לנתינת יין לנזיר דהתם היין הוא המכשול משא"כ הכא אין התורה
המכשול אלא הקביעות והכוונה לחדש דת ויש לפלפל בזה
And in my opinion there is no prohibition on the teacher even in a
situation where the non-Jew intends it for the sake of the mitzvah,
for this is not comparable to giving wine to a nazir where the wine
[itself] is the stumbling block, whereas here it it is not the Torah
that is the stumbling block but the designation and intent to
originate religion [that is the stumbling block]. And there is what to
discuss about this.
So in sum, according to R. Weinberg's understanding of Rambam there would be no problem with a non-Jew asking a Jew to explain some area of halacha, unless the non-Jew is doing it because he wants to fulfill the mitzvah of learning Torah, and even then there would probably be no problem for the Jew to provide the explanation because by teaching him Torah he is not providing him with the forbidden object, as the forbidden object in this case is the non-Jew's intent.