my_text_field.secure = True should do the trick (no idea why this is missing from the docs). If you're using the UI editor, you can enable the "Password Field" switch instead.