As of Beautiful Soup 4.0.5 (released back in 2014), we now have PageElement.wrap(). See: https://www.crummy.com/software/BeautifulSoup/bs4/doc/#wrap
Simple example:
from bs4 import BeautifulSoup
soup = BeautifulSoup("<body><a>Some text</a></body>")
soup.a.wrap(soup.new_tag("b"))
print(soup.body)
# <body><b><a>Some text</a></b></body>