Idempotence in HTTP is not exactly the same as idempotence in
mathematics
No. The meaning is exactly the same.
In the mathematics a function is idempotent if f(f(x)) = f(x).
Let's define f(123) as "DELETE /users/123". Then f(f(123)) means 2 subsequent calls of "DELETE /users/123". If the 1st call deleted a user with ID = 123, then the 2nd call will not find anything to delete and the system state will be the same as after the 1st call. Means, f(f(123)) = f(123), which means it is idempotent.
Important assumption is that the implementation of HTTP methods follows RFC. Because technically you can implement the service in such way that it changes significant data via GET. This would be bad architectural style. But nevertheless we should not forget that this may happen and we should check if particular application really follows RFC recommendations.
what exactly does 'side-effect' mean
To some extent it depends on the context, on the definition.
Example 1. There is a database. Method "GET /users/123" returns data of the user with ID 123 and does not change anything in the database. This is usually considered as "no side effects". Such call may produce log entries on proxy servers on its way, in the application logs, etc. But usually this is ignored.
Example 2. Method "GET /users/123" returns data of the user with ID 123. But application has a specific log table in the database, and every GET call creates a log entry in this database. Many developers will say that significant data don't change in such case. But some may consider it as a significant data change.
Briefly: It makes sense to first talk to your team and define the terms for particular context (project, application), so that everyone in the team understands the words in the same way. Put such definitions to a glossary and make available to all relevant persons.
There is a big potential of confusing safe and idempotent.
It depends on the person. Some may find it confusing, the others don't.
A method is safe if it doesn't change significant data.
But idempotent method may change significant data. What matters is the system state after subsequent calls: Do they produce the same result as the 1st request or not? If the state is the same, then the method is idempotent. For instance, "DELETE /users/123" deletes a user with ID = 123 and thus performs a significant change of data. The 2nd and subsequent calls of "DELETE /users/123" will not change anything more. Thus the state after the 2nd call is the same as after the 1st call. That's why such method is idempotent. Same with PUT or PATCH. The can change data once. But subsequent calls don't change the system state any more and thus are idempotent.
So, the methods DELETE, PUT, PATCH are not safe (in the sense of RFC), because the can change significant data. But they are idempotent.
Consequence: If a method is safe, it is also idempotent. If method is idempotent, it doesn't necessarily mean that it is safe.