You can consider the old Schnackenberg's article "How to calculate stress in above/below ground transition". Fortunately, this reference article is included in Pipeline rules of thumb handbook.
The key parameter considered in article is "the longitudinal resistance of the soil that needs to be known".
In fact, Schnackenberg's model is a simple linear one, where the stress difference between "fully restrained" and "unrestrained" points (multiplied by pipeline metal sectional area) generates a tendency to "elongate" to the ends of pipeline (typically toward pig stations).
In case you decide to fight with that "elongation", you may consider an anchor block in front of pig station. In case you decide to accept that elongation, you would rather consider a "Z" shaped loop in that zone; the only "difficulty" is that the pipeline leg and nearby bends must be properly analyzed taking into consideration the pipeline-soil interaction.