I have a page with 4 ACF tabs. is there a way in my template to include a foreach tab function?
Tabs are not actually fields and are not stored. The fields in each tab are not associated with the tab in any way. Tabs are just an admin layout feature of ACF. So really, there is nothing in ACF itself that will allow you to do this.
If I found myself needing to do this I would probably create a nested array that defined the fields I wanted to show for each tab and then loop through that array to create the foreach tab effect, something like:
$array = (
// these are the field names for tab 1
// these are the field names for tab 2