As pointed by @mzjn, implicit targets are discouraged so maybe his answer is better in practice. Regardless, I wanted to be able to use implicit targets sometimes.
So I tested to suppress the hyphen and it works ! (so use #pyprojecttoml)
test_page.md :
# test page
[click on this link to plouf](#this-is-ok)
## this is ok
[click on this link to pypro](#pyprojecttoml)
## `pyproject.toml`
It seems that some characters are just skipped (and not hyphened) by implicit targets: at least ` and ., maybe others.