The problem here is the build isn't linking against libpython3
$ ldd /usr/lib/x86_64-linux-gnu/weechat/plugins/python.so linux-vdso.so.1 (0x00007ffd8eb94000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1ae4b37000) /lib64/ld-linux-x86-64.so.2 (0x00007f1ae4d83000)
The problem here is the build isn't linking against libpython3
$ ldd /usr/lib/ x86_64- linux-gnu/ weechat/ plugins/ python. so
linux- vdso.so. 1 (0x00007ffd8eb9 4000) 64-linux- gnu/libc. so.6 (0x00007f1ae4b3 7000)
/lib64/ ld-linux- x86-64. so.2 (0x00007f1ae4d8 3000)
libc.so.6 => /lib/x86_