How to stop TextEdit.app from adding extended attributes

TextEdit should not (and does not) normally add quarantine attributes to files that it saves. It's possible that MacOS is adding the quarantine for some other reason. (Where are you saving to?)

However, there are other extended attributes, which TextEdit may add during the course of normal operation in MacOS.

Normally, extended attributed don't get copied to things like github, and are simply unused by other platforms, even if present.

I also agree with bmike. If an app has a behaviour you don't like, then use another app.