But it's built on patented codec (H.265). It's illegal to use it without a patent license, regardless whether it's a standard or not. Even if you wrote your own implementation, it would be illegal for you to use your own code.
Technically HEIF is a good format — it's half the size of WebP. WebP is based on a much weaker codec that is two generations older. AVIF is a freely-licensed HEIF alternative.
> The HEIC holds the HEIF data that is compressed using HEVC by MPEG
Wrapping a HEVC file in a container does not automatically void any patents of the contained file. Otherwise, anyone can shove any patent encumbered file format in a ".zip" container (or any container/wrapper) and avoid any patent or licensing issues.