I think you want to learn about insert mode abbreviations.
:iabbrev :bang #!/usr/bin/python3.9
When you type :bang in INSERT mode, the text will be replaced to #!/usr/bin/python3.9 when you trigger the abbreviation. Abbreviations are triggered when you hit the space bar or return key (among other ways).
For an abbreviation with multi-lines, use the <cr&...