gh-36806: add generic has_order() function
Currently there is `order_from_multiple()` for generic groups, but
sometimes we really only want to know if the order equals a particular
value (e.g., when sampling random elements to find a generating set of a
group with known structure). This means the computation can be aborted
earlier than when finding the exact order is required.
In this patch we add such an optimized `has_order()` function as well as
a convenience wrapper for elliptic-curve points. An example of the
speedup can be found in one of the new doctests.
URL: https://github.com/sagemath/sage/pull/36806
Reported by: Lorenz Panny
Reviewer(s): Lorenz Panny, Travis Scrimshaw