Three-syllable abbreviation of three reduplicated phrases: 马马虎虎 (mǎmǎhūhū, careless), 大大咧咧 (dàdàliēliē, sloppy), 嘻嘻哈哈 (xīxīhāhā, giggly/unserious). Take the first syllable of each: 马 + 大 + 哈.
register
Casual and affectionate-mocking. Works as a noun ('you're such a scatterbrain') or adjective ('don't be careless'). Popularized by Ma Sanli's 马三立 1956 xiangsheng 《买猴儿》, where the bumbling clerk's name became shorthand for the type.