There is an idea mentioned by the Rambam, but not in the Mishneh Torah as I recall, that it is permissible to teach Wrtitten Torah to Christians because they accept it as Divine and don't study it in a strictly academic/detached way. Where does he, and does he in fact, rule this way? How would this apply to teaching Oral Torah to someone such as a b'nei Noach who accepts it?
The source you are looking for is the Rambam's responsa (§149), where the Rambam writes:
השאלה הל"א שאלה מאמר ר' יוחנן גוי שעסק בתורה חייב מיתה, האם זה הלכה והחייב כל בר ישראל להמנע (מללמדו) דבר מן המצות חוץ משבע מצות או להעמידו עליהן, אם לאו?
התשובה היא הלכה בלא ספק. וכאשר יד ישראל תקיפה עליהם, מונעים אותו מתלמוד תורה עד שיתגייר. אבל לא יהרג, אם עסק בתורה, לפי שאמר חייב מיתה ולא אמר נהרג כמו שאמרו על שבע מצות בן נח נהרג. ומותר ללמד המצות לנוצרים ולמשכם אל דתנו, ואינו מותר דבר מזה לישמעאלים, לפי מה שידוע לכם על אמונתם, שתורה זו אינה מן השמים, וכאשר ילמדום דבר מן כתוביה (וימצאוהו) מתנגד למה שבדו הם מלבם לפי ערבוב הסיפורים ובלבול העניינים אשר באו להם, (הרי) לא תהיה זו ראיה אצלם, שטעות בידיהם, אלא יפרשוה לפי הקדמותיהם המופסדות ויוכלו להשיב עלינו בזה בטענתם ויטעו כל גר וישראל, שאין לו דעת, ויהיה זה מכשול לישראל האסורין ביניהם בעונותם. אבל הנוצרים מאמינים בנוסח התורה שלא נשתנה, ורק מגלים בה פנים בפרושם המופסד ומפרשים זאת בפירושים, שהם ידועים בהם, ואם יעמידום על הפרוש הנכון, אפשר שיחזרו למוטב, ואפילו לא יחזרו, כשרוצים שיחזרו, לא יבוא לנו מזה מכשול ולא ימצאו בכתוביהם דבר שונה מכתובינו.
Question: Regarding the statement of R' Yochanan [Sanhedrin 59a] that a non-Jew who delves into Torah study is chayav misa [lit. "liable for death"], is this the law, and are all Jews obligated to avoid teaching a non-Jew anything from the commandments, besides for the seven Noahide laws, or to avoid bringing him to understand them, or not?
Answer: This is undoubtedly the law. And when Jews would have dominion over a non-Jewish population, the Jews would prevent a non-Jew from Torah study until he would convert. But he is not killed if he studied Torah, since it says he is "liable for death" and it doesn't say "he is killed" as it does with respect to transgression of the seven Noahide laws.1
And it is permitted to teach Christians the commandments, and to attract them towards our religion. But this thing is not permitted with Muslims, as is known to you regarding their faith, that this Torah is not from heaven, and when you teach them something from its scriptures, if they find it contrary to that which they have imagined from the muddled stories and warped ideas that have reached them, the scripture will be no proof to them, for they maintain this mistaken view. Rather, they will interpret the scripture according to their preconceived misconception, and they will be able to respond with this claim. And any convert2 or Jew who lacks knowledge may thereby err, and this would be a stumbling block to the Jews who are trapped amongst them (due to their sins).
However, the Christians accept that our version of the Torah is unchanged, except that they misrepresent it with their deficient interpretations, and they explain it with interpretations that are known to them. And if they would be corrected with the proper interpretation, they might return to the right way. And even if they don't recant, if they want us to recant3 we will not have a stumbling block from this, since nothing found in their scriptures [of the Old Testament] is different from our scriptures.
When the Rambam writes, "וכאשר יד ישראל תקיפה עליהם מונעים אותו מתלמוד תורה עד שיתגייר", I'm not sure if the Rambam meant that we don't teach non-Jews Torah until the conversion process is complete, or if he meant that we don't teach them Torah until they come seeking to convert. In any case, it appears likely from this responsum, and from the the Rambam's ruling in Hil. M'lachim 10:9, that even a ben Noach who accepts the divinity of the Torah (see Hil. M'lachim 8:11) may not study Torah other than as pertains to him (however, the scope of what Torah pertains to a non-Jew may be quite broad - see this answer).
If so, perhaps we could reconcile this with the Rambam's remarks about Christians by saying that, absent a need to correct someone's aberrant understanding of the Torah, we don't teach Torah (and, even then, teaching them is conditional on their prior acceptance of our "textus receptus" of the Tanach).
The motivation for allowing correcting Christians' mistaken understanding of the Torah may be related to the teaching in Avos (2:14) to "know how to respond to a heretic". The Rambam (commentary on Avos ad loc.) comments that "you must learn what you will need to know to respond to non-Jewish heretics, and dispute them and reply to them if they pose a challenge to you".
1 According to halacha, non-Jews are obligated to establish secular courts of law. These courts are theoretically empowered by halacha to punish transgressors of the seven Noahide laws under certain circumstances.
2 This can also be translated as "stranger", meaning non-Jew.
3 Alternatively, this might also be translated as: "And even if they don't return to the right way when we want them to return, we will not have a stumbling block from this..."
It is not only permissible to teach written Torah to the Gentiles but also highly recommendable. Prophet Isaiah himself says that in the last days, when the mountain of the Lord shall be established in the top of the mountains, many people shall go and say, "Come, let us go up to the mountain of the Lord, to the House of the G-d of Yakov, and He will teach us of His ways, and we will walk in His paths; for out of Zion shall go forth the Law, and the Word of the Lord from Jerusalem." (Isa. 2:2,3) "And in those days it shall come to pass that the nations shall take hold of the garment of him who is a Jew and beg of him to let them join Israel, because they have finally acknowledged that HaShem is with us." (Zech. 8:23) I know we have stopped proselytizing Gentiles, because of Antisemitism. But if we think it through, the best way to fight Antisemitism is by making a Jew out of the anti-Semite.
A few years ago, a family of five Christians from the Seventh-Day Adventist Church knocked at my door and, very politely, asked me to be allowed to speak a word to me about Jesus. I invited them in. It was on a Shabbat afternoon. After about two months, I realized a change in their attitude. They were listening more and speaking very little, and more in terms of questions. They ne'elemu (disappeared) for about eitht months when I got an invitation for their ceremony of conversion. And Orthodox style conversion, according to Halacha, mind you. And I was presented as the reason why they had decided to join Judaism. The two daughters of the family got married with two nice Israeli youngmen, while I was chosen to be the best man. Today, each one has two born Jewish children. It means I have contributed with nine very happy souls to Judaism. Baruch HaShem.
The Maharatz Chiyos to Sotah 35b writes that a Jew can teach Tanach to a gentile. The Netziv (Meshiv Davar, Yoreh Deah 77) and R. Yehudah Assad (Yehudah Ya’aleh, Orah Hayim 4) agree. Also the Rambam in Responsa Pe’er Ha-Dor 50. The Meor Veshemesh (Parshas Chukas) writes that it is permitted to teach the Written Law to an idolater. This is like Moshe who wrote the Torah in seventy languages. The prohibition of teaching Torah to Christians applies only to the Oral Law. Also the Netziv again in his Pirush Al Hatorah in Vayikra 18:5 says explicitly that a non-Jew can learn Torah shebiktav. Also The Divrei Chaim (Chanukah) says that the Torah was written on the stones and the nations of the world copied it over. The Medrash says that Hashem allowed them to study the Written Law. For more see here: TEACHING TORAH TO A GENTILE PLANNING ON CONVERTING. And just to be Jewish you know that the gemara says a non-Jew who learns torah is like the Kohen Gadol? (A"Z 3a) ?