Minecraft wiki entry for Exploring_an_ancient_city, associated text: The player can run out of the sculk shrieker's range. A sculk shrieker has a spherical range of 16 blocks. If the player gets outside the 16-block radius before the 4.5-second shrieking ends, then the shrieker will not inflict Darkness on the player. This is only a viable option if there are no other shriekers nearby to break.
The player can break the shrieker before its shrieking ends. A Hoe is the fastest way to break shriekers, so a player with a fast hoe can quickly break multiple shriekers within a short period of time, allowing for a dangerous but faster way to raid and secure the city.