You cannot replace the ATT gateway but may placed a purchased unit behind using either DMZ or IP Passthrough depending on model of gateway. There are instructions on how in these forums, need to search based on model number.
Speeds will be affected, how much depends on your settings and equipment. The more secure will result in slower speeds. Thus a compromise, more control means your responsible for your network.
*I am an AT&T employee, and the postings on this site are my own and don't necessarily represent AT&T's position, strategies or opinions.