If you coordinates are all in the same systems and ready to go, just as simple minimum bounding box algorithm is needed.
Iterate over your list and just find maxX, minX, maxY and minY by comparing each layer at a time. As you check each layer keep the biggest and the smallest value for X and Y by the time you get to the end of the list you should have the values for the MBR for the entire layer set.
# This example we'll have a multi-dimensional array of layer boundaries.
# Index boundaries starting at top and going clock-wise.
layers_boundaries = [[52,86,20,12],[89,85,-12,-1],[25,12,10,8]]
maxX = 0
minX = 0
maxY = 0
minY = 0
for layer in layer_boundaries
if layer > maxX # Check the top boundary of the layer.
maxX = layer
if layer > maxY # Check the right boundary of the layer.
maxY = layer
if layer < minX # Check the bottom boundary of the layer.
minX = layer
if layer < minY # Check the left boundary of the layer.
minY = layer
# By here, we should have the MBR of the layers.
print(maxX, minX, maxY, minY)
As your datasets grow it may be faster to have PostGIS find the boundaries for you. If you have spatial indices turned on and setup, the database should update MBRs every time it needs to and should know the answer to your question already, you just need to spend the time to craft the SQL to query for the MBR for all layers. And if I am not mistaken, if queried about this data often it will 'learn' to index this ahead in its off-time and have this ready, if it doesn't already.