Checking for three is a subset of checking for many; so, I am going to consider the more general solution. I will discuss the three point solution at the end.
First, convert the polar coordinates to Cartesian Coordinates.
First, to make things simple, use your robot as the reference frame (make it the center of the universe).
That means, for each target calculate:
Here is a Post on Converting Coordinates in Python
After you have all these calculate the slope and intercept of the line using linear regression; then, calculate R-squared (the Coefficient of determination) to determine how well the measurements fit a line. Note: Any measurement system is going to have errors; so, the points will likely never perfectly fit a line.
If the number is too high, try dropping out points the deviate furthest from the line. Maybe you could group them together and if they have a low r-squared then you have found another wall.
I am sure there are lots of Python regression libraries. Here is a reference I found on Calculating R-squared in Python.
If you are only going to use three points, you could likely simplify this by using the middle point as your reference and see if the slope to the other two point are exactly/nearly opposite.
Here are some other approaches for How to find if three points fall in a straight line or not.