Subject-ID Assignment

The idiomatic approach is to assign a separate Subject-ID per sensor, as you described.

The libcanard RAM utilization per session is something that may require revision. For example, in libudpard, where the maximum number of nodes is 65535 (from 0 to 65534), the static table approach adopted in libcanard is no longer viable, so we use a O(\log n) tree instead; perhaps the same approach should be applied in libcanard as well, possibly as a build option.

The compromises you listed are well-known indeed, and they are known to cause significant issues in practical deployments. I advise avoiding them.

For the bloat issue you mentioned, check out this RFC: RFC: add array of ports. Any input would be appreciated (I am yet to provide mine).