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.
my_text_field.secure = True
Disabled Categories are greyed out
Oops! Looks like something went wrong!
You may only upload PNG, JPG, or GIF files ()