Depending on how exactly you draw the line on 'slavery'... maybe? Kinda?
For the Great Pyramid, the current approximate consenus is that it was basically a corvee labor system for a large amount of the population of Egypt.
Basically, when the farmers were all in their off season, they'd be drafted for a number of months a year to aid construction as general laborers.
They were housed, fed, and paid for this, by the state/royal coffers.
They were paid in material goods like foodstuffs, as currency in the way we think of it wasn't really a thing at the time.
And yes, they absolutely did have divisions of labor, they had basically nobility or psuedo nobilility people who could largely read and write as trained architects and engineers and mathematicians and record keepers and accountants, and had a whole slew of the craftsmen / stone mason class below them.
So... it is forced labor, you couldn't really opt out, but you would be compensated.
Egypt did have roughly chattel slaves at the time, they probably participated as well, but they are estimated to be about 10% of the total population of Egypt at the time.
(Compare this to say, 1st century AD/CE Rome, where I think the estimate is more like roughly 20-30% being slaves)
There is also the religious component: It is likely that many of the drafted laborers viewed this as a privilege or sacred duty to construct the tomb of their living god-king, who they would have believed became essentially immortal, his spirit would be preserved for eternity, as a consequence of their work.
So maybe think of it as an extremely intensive mission trip to go build shelters for the needy, as a rough analogue to modernity... it was some kind of good, moral, holy thing to do.
I realize this is a joke, and it did elicit a good chuckle from me, but I have two technical sort of nit picks / factoids.
As I understand these things:
To the vast majority of Catholics, the Pope is not literally a god-king, who becomes basically a minor god oh his physical death, or just literally is onenof the greater gods made incarate... the Pope is God's chosen representative on Earth, sort of like a more formalized version of many Old Testament prophets, who also leads God's church.
Also... the Amish, the Mennonites... they very much do have as part of their culture, which very much revolves around religion... that you more or less are a expected to, and by this cement that you are a good person of faith and character, that you help others by participating, often regularly, in work-gangs, to stand up at least the basics of barn or house, in what is a shockingly short amount of time, and done in a very high quality manner, with less technologically advanced tools than what is normal for others.
Seriously, if you've never seen this, go look up something like Amish Barn Raising on youtube.
They start with basically just raw materials, assemble large parts of the framing, stand em up with just ropes, set up and join the whole thing, get the outer walls and roof on and doors on, in under a a single work day.